Вы можете удалить его так:
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier];
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];
Чтобы запустить его при первом запуске, я бы просто установил флаг BOOL.Один из способов сделать это заключается в следующем:
- (void)applicationDidFihishLaunching
{
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if ([[prefs objectForKey:@"secondOrMoreTimeLoading"]boolValue]==0) //so if there is nothing there...
{
NSLog(@"This is the first time the user has loaded the application. Welcome!");
//run the code above here, then change our flag to 1 so that it never runs this again (unless the prefs are reset elsewhere)
[prefs setObject:[NSNumber numberWithBool:1] forKey:@"secondOrMoreTimeLoading"];
}
else{NSLog(@"Welcome back, user.");}
}