AppDelegate.m 에서 앱이 설치 후 처음 실행되었을 때 와 이미 실행된 적이 있을 때를 구분해서 코드를 만들어 줄 수 있다.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"]) { // 설치 후 이미 실행한 적이 있을 때 } else { // 설치 후 처음 실행 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"]; // 처음 실행을 저장 [[NSUserDefaults standardUserDefaults] synchronize]; } return YES; } |
'개발 거들기 > iOS 개발' 카테고리의 다른 글
Sample(01) - Hello World (iOS-XCode) (0) | 2014.09.26 |
---|