cocoaTouch/iPad/TeamSettingsViewController.m
changeset 3270 9bd8fb1707b9
parent 3253 b0b1b1310b7e
child 3276 039145459ac8
equal deleted inserted replaced
3269:258d7f87c96e 3270:9bd8fb1707b9
    25     self.list = contents;
    25     self.list = contents;
    26    
    26    
    27     // Uncomment the following line to preserve selection between presentations.
    27     // Uncomment the following line to preserve selection between presentations.
    28     // self.clearsSelectionOnViewWillAppear = NO;
    28     // self.clearsSelectionOnViewWillAppear = NO;
    29     // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    29     // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    30     // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    30     self.navigationItem.rightBarButtonItem = self.editButtonItem;
    31 }
    31 }
    32 
    32 
    33 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    33 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    34     // Override to allow orientations other than the default portrait orientation.
    34     // Override to allow orientations other than the default portrait orientation.
    35     return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    35     return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
   112 */
   112 */
   113 
   113 
   114 
   114 
   115 #pragma mark -
   115 #pragma mark -
   116 #pragma mark Table view delegate
   116 #pragma mark Table view delegate
   117 
       
   118 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
   117 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
   119  if (childController == nil) {
   118     if (1 == [indexPath section]) {
   120         childController = [[SingleTeamViewController alloc] initWithStyle:UITableViewStyleGrouped];
   119         if (childController == nil) {
       
   120             childController = [[SingleTeamViewController alloc] initWithStyle:UITableViewStyleGrouped];
       
   121         }
       
   122         
       
   123         NSInteger row = [indexPath row];
       
   124         NSString *selectedTeam = [[list objectAtIndex:row] stringByDeletingPathExtension];
       
   125         
       
   126         childController.teamName = selectedTeam;
       
   127         [self.navigationController pushViewController:childController animated:YES];
   121     }
   128     }
   122     
       
   123     NSInteger row = [indexPath row];
       
   124     NSString *selectedTeam = [[list objectAtIndex:row] stringByDeletingPathExtension];
       
   125 
       
   126     childController.title = selectedTeam;
       
   127     [self.navigationController pushViewController:childController animated:YES];
       
   128 
       
   129 }
   129 }
   130 
   130 
   131 /*
   131 /*
   132 -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
   132 -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
   133     UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Hey, do you see the disclosure button?" 
   133     UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Hey, do you see the disclosure button?"