cocoaTouch/iPad/TeamSettingsViewController.m
changeset 3253 b0b1b1310b7e
parent 3251 221c163ad5d9
child 3270 9bd8fb1707b9
equal deleted inserted replaced
3252:1550881c5bb8 3253:b0b1b1310b7e
    20     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    20     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    21     NSString *teamsDirectory = [[paths objectAtIndex:0] stringByAppendingString:@"Teams/"];
    21     NSString *teamsDirectory = [[paths objectAtIndex:0] stringByAppendingString:@"Teams/"];
    22     
    22     
    23     NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:teamsDirectory
    23     NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:teamsDirectory
    24                                                                             error:NULL];
    24                                                                             error:NULL];
    25     //NSArray *array = [[NSArray alloc] initWithObjects:@"Toy Story", @"A Bug's Life", @"Toy Story 2", 
       
    26     //                  @"Monsters, Inc.",@"Finding Nemo", @"The Incredibles", @"Cars", @"Ratatouille", 
       
    27     //                  @"WALL-E", @"Up", @"Toy Story 3", @"Cars 2", @"The Bear and the Bow", @"Newt", nil];
       
    28     self.list = contents;
    25     self.list = contents;
    29    
    26    
    30     // Uncomment the following line to preserve selection between presentations.
    27     // Uncomment the following line to preserve selection between presentations.
    31     self.clearsSelectionOnViewWillAppear = NO;
    28     // self.clearsSelectionOnViewWillAppear = NO;
    32     // 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.
    33     // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    30     // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    34 }
    31 }
    35 
    32 
    36 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    33 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
   122  if (childController == nil) {
   119  if (childController == nil) {
   123         childController = [[SingleTeamViewController alloc] initWithStyle:UITableViewStyleGrouped];
   120         childController = [[SingleTeamViewController alloc] initWithStyle:UITableViewStyleGrouped];
   124     }
   121     }
   125     
   122     
   126     NSInteger row = [indexPath row];
   123     NSInteger row = [indexPath row];
   127     NSString *selectedMovie = [[list objectAtIndex:row] stringByDeletingPathExtension];
   124     NSString *selectedTeam = [[list objectAtIndex:row] stringByDeletingPathExtension];
   128     NSString *detailMessage = [[NSString alloc] initWithFormat:@"you pressed the button for %@", selectedMovie];
       
   129 
   125 
   130     childController.title = selectedMovie;
   126     childController.title = selectedTeam;
   131     [detailMessage release];
       
   132     [self.navigationController pushViewController:childController animated:YES];
   127     [self.navigationController pushViewController:childController animated:YES];
   133 
   128 
   134 }
   129 }
   135 
   130 
   136 /*
   131 /*