// // IntegrationProfilesViewController.m // TFBrowser // // Created by JB Meyer on 1/15/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "IntegrationProfilesTableViewController.h" #import "IntegrationProfile.h" #import "IntegrationProfileDetailsTableViewController.h" #import "IntegrationProfileDataSource.h" #import "ActorIntegrationProfileOption.h" #import "ActorIntegrationProfile.h" #import "Actor.h" #import "IntegrationProfile.h" #import "TFObjects.h" #import "TFBrowserAppDelegate.h" #import "IntegrationProfileDataSource.h" @implementation IntegrationProfilesTableViewController @synthesize ipTableView ; @synthesize integrationProfileDataSource ; @synthesize integrationProfileDetailsTableViewController ; /* - (IntegrationProfilesTableViewController *)init { if ([super initWithNibName:@"IntegrationProfilesViewController" bundle:nil]) { // retain the data source IntegrationProfileDataSource * theDataSource = [[IntegrationProfileDataSource alloc]init]; self.integrationProfileDataSource = theDataSource; self.tableView.dataSource = integrationProfileDataSource ; // set the title, and tab bar images from the dataSource // object. These are part of the ElementsDataSource Protocol self.title = [integrationProfileDataSource name]; self.tabBarItem.image = [integrationProfileDataSource tabBarImage]; // set the long name shown in the navigation bar self.navigationItem.title=[integrationProfileDataSource navigationBarName]; // create a custom navigation bar button and set it to always say "back" UIBarButtonItem *temporaryBarButtonItem=[[UIBarButtonItem alloc] init]; temporaryBarButtonItem.title=@"Back"; self.navigationItem.backBarButtonItem = temporaryBarButtonItem; //updateDBButton = [[UIBarButtonItem alloc] initWithTitle: @"Update" style:UIBarButtonSystemItemAdd // target:self action:@selector(updateFromDB)]; [theDataSource release]; [temporaryBarButtonItem release]; } return self; } */ /* - (id)initWithStyle:(UITableViewStyle)style { // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. if (self = [super initWithStyle:style]) { } return self; } */ - (void)viewDidLoad { [super viewDidLoad]; if ( integrationProfileDataSource == nil ) { integrationProfileDataSource = [[IntegrationProfileDataSource alloc]init]; self.tableView.dataSource = integrationProfileDataSource ; } // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; } /* - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } */ /* - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } */ /* - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } */ /* - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } */ /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } #pragma mark Table view methods - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; IntegrationProfile * profile =(IntegrationProfile *) [integrationProfileDataSource tfObjectForIndexPath:indexPath ]; if ( profile != nil ) { IntegrationProfileDetailsTableViewController * myProfileViewController = [[IntegrationProfileDetailsTableViewController alloc] initWithNibName:@"IntegrationProfileDetailsTableViewController" bundle: nil ] ; [self setIntegrationProfileDetailsTableViewController:myProfileViewController]; integrationProfileDetailsTableViewController.hidesBottomBarWhenPushed = YES ; [myProfileViewController release ]; integrationProfileDetailsTableViewController.integrationProfile = profile ; // push the element view controller onto the navigation stack to display it TFBrowserAppDelegate * delegate = [[UIApplication sharedApplication] delegate]; [[delegate integrationProfilesNavigationController] pushViewController:integrationProfileDetailsTableViewController animated:YES ]; [profile release]; } } /* // Override to support conditional editing of the table view. - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the specified item to be editable. return YES; } */ /* // Override to support editing the table view. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { // Delete the row from the data source [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; } else if (editingStyle == UITableViewCellEditingStyleInsert) { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { } */ /* // Override to support conditional rearranging of the table view. - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the item to be re-orderable. return YES; } */ - (void)dealloc { [integrationProfileDataSource release]; [super dealloc]; } @end