summary refs log tree commit diff stats
path: root/Classes/HighscoreListController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Classes/HighscoreListController.m')
-rwxr-xr-xClasses/HighscoreListController.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/Classes/HighscoreListController.m b/Classes/HighscoreListController.m index 7dbefa1..7370da5 100755 --- a/Classes/HighscoreListController.m +++ b/Classes/HighscoreListController.m
@@ -22,7 +22,7 @@
22 // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 22 // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
23 self = [super initWithStyle:style]; 23 self = [super initWithStyle:style];
24 if (self) { 24 if (self) {
25 localHighscores = [Highscore localHighscoreListForGameMode:@"Collect"]; 25 localHighscores = [[Highscore localHighscoreListForGameMode:@"Collect"] retain];
26 26
27 navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; 27 navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
28 myNavigationItem = [[UINavigationItem alloc] initWithTitle:@"Highscores"]; 28 myNavigationItem = [[UINavigationItem alloc] initWithTitle:@"Highscores"];
@@ -48,6 +48,7 @@
48 toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 480-44, 320, 44)]; 48 toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 480-44, 320, 44)];
49 [toolbar setItems:[NSArray arrayWithObjects:barButton3, btnSpace, barButton2, nil] animated:NO]; 49 [toolbar setItems:[NSArray arrayWithObjects:barButton3, btnSpace, barButton2, nil] animated:NO];
50 [barButton2 release]; 50 [barButton2 release];
51 [btnSpace release];
51 [barButton3 release]; 52 [barButton3 release];
52 53
53 showGlobal = NO; 54 showGlobal = NO;
@@ -326,13 +327,16 @@
326 327
327- (void)switchGameMode:(id)sender 328- (void)switchGameMode:(id)sender
328{ 329{
330 [localHighscores release];
331
329 if ([(UISegmentedControl*)sender selectedSegmentIndex] == 0) 332 if ([(UISegmentedControl*)sender selectedSegmentIndex] == 0)
330 { 333 {
331 localHighscores = [Highscore localHighscoreListForGameMode:@"Collect"]; 334 localHighscores = [[Highscore localHighscoreListForGameMode:@"Collect"] retain];
332 } else { 335 } else {
333 localHighscores = [Highscore localHighscoreListForGameMode:@"Jump"]; 336 localHighscores = [[Highscore localHighscoreListForGameMode:@"Jump"] retain];
334 } 337 }
335 338
339 [globalHighscores release];
336 globalHighscores = nil; 340 globalHighscores = nil;
337 341
338 [self switchLists:areaControl]; 342 [self switchLists:areaControl];