Reputation: 6184
Is there an easy way to have an alert appear only the first time an app is launched, or will I have to do it manually by making a BOOL and having it set to FALSE after it's run the first time?
Upvotes: 1
Views: 375
Reputation: 6360
Sounds easy enough...
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if(![defaults boolForKey:@"hasBeenLaunchedBefore"]) {
//Show alert
[defaults setBool:YES forKey:@"hasBeenLaunchedBefore"];
[defaults synchronize];
}
Upvotes: 5