32 NSLocalizedString(@"Flag",@""), |
32 NSLocalizedString(@"Flag",@""), |
33 NSLocalizedString(@"Level",@""),nil]; |
33 NSLocalizedString(@"Level",@""),nil]; |
34 self.secondaryItems = array; |
34 self.secondaryItems = array; |
35 [array release]; |
35 [array release]; |
36 |
36 |
37 // load data about the team and extract info |
37 |
38 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); |
|
39 NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/Teams/%@.plist",[paths objectAtIndex:0],self.title]; |
|
40 NSMutableDictionary *teamDict = [[NSMutableDictionary alloc] initWithContentsOfFile:teamFile]; |
|
41 [teamFile release]; |
|
42 self.teamDictionary = teamDict; |
|
43 [teamDict release]; |
|
44 |
38 |
45 // listen if any childController modifies the plist and write it if needed |
39 // listen if any childController modifies the plist and write it if needed |
46 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setWriteNeeded) name:@"setWriteNeedTeams" object:nil]; |
40 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setWriteNeeded) name:@"setWriteNeedTeams" object:nil]; |
47 isWriteNeeded = NO; |
41 isWriteNeeded = NO; |
48 } |
42 } |
49 |
43 |
50 - (void)viewWillAppear:(BOOL)animated { |
44 - (void)viewWillAppear:(BOOL)animated { |
51 [super viewWillAppear:animated]; |
45 [super viewWillAppear:animated]; |
52 |
46 |
53 // grab the name of the team |
|
54 self.title = [self.teamDictionary objectForKey:@"teamname"]; |
47 self.title = [self.teamDictionary objectForKey:@"teamname"]; |
55 |
48 |
56 // load the images of the hat for aach hog |
49 // load the images of the hat for aach hog |
57 NSArray *hogArray = [self.teamDictionary objectForKey:@"hedgehogs"]; |
50 NSArray *hogArray = [self.teamDictionary objectForKey:@"hedgehogs"]; |
58 NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[hogArray count]]; |
51 NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[hogArray count]]; |