- 解档
//AppDelegate.m @synthesize window=_window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSString* gameArchivePath = [self gameArchivePath]; OneGame* existingGame; @try { existingGame = [[NSKeyedUnarchiver unarchiveObjectWithFile:gameArchivePath] retain]; } @catch (NSException *exception) { existingGame = nil; } [gameController setPreviousGame:existingGame]; [existingGame release]; //设置为主窗口并显示出来 [self.window makeKeyAndVisible]; return YES; } //GameController.m -(void)setPreviousGame:(OneGame*)aOneGame{ previousGame = [aOneGame retain]; if (previousGame != nil && [previousGame remaingTurns] > 0){ [continueButton setHidden:NO]; } else { [continueButton setHidden:YES]; } }
- 存档
原文地址:https://www.cnblogs.com/HackHer/p/8158994.html
时间: 2024-10-12 19:49:10