I have an app where I need a BOOL value to persist across launches.
The value should be YES on the first launch and user-customizable thereafter.
But if it’s the first launch, how do I set the default to YES before the program is run?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to register a dictionary of default values with NSUserDefaults on every launch of your app:
Now,
will return YES if the key is not present.