// applicationDidFinishLaunching from your main app delegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// ... standard apple code
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"isFirstLaunch",nil]];
}
// to check the first launch in the code
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"isFirstLaunch"]) {
// place your code here
}
// put this code to your applicationWillTerminate function to set "isFirstLaunch" to NO after first launch
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"isFirstLaunch"];
We had to disable comments till the problem with spam will be solved, sorry for any inconvenience caused.