as I get closer to releasing my app, I'm trying to make sure that I'm using stable code to check if the app has been launched before (in order to perform some first time setup). Is this (obviously a no frills method that doesn't take into account app version and updates) pretty much a rock solid way to determine if the app has been launched?
In my app delegate didFinishLaunchingWithOptions method, I perform the following each time:
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
if(![defaults objectForKey:@"not_first_launch"])
{
NSLog(@"This is the first time the app has been launched.\nPerforming first-time setup procedures...");
[self runFirstTimeSetup];
}
My second question is basically, can I assume that when I release an app update, that the user's documents directory for my specific app's sandbox will be left unerased? Does an app update simply add to the directory, not wipe it clean and re-install? I need the user's files to stick around even when I update the app (pretty obvious) but I don't want to make the wrong assumption and have users lose data every time I release an update.
Thanks!