How do you call a method on only the initial launch of an application? For example, if you wanted to put a tutorial UIAlertView on the very first launch but never again after that?
Share
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.
Easy. When your app launches, check
[NSUserDefaults standardUserDefaults]for the presence of a bool that you put in there. If the boolean isn’t there (or it’s not YES), then show the alert and save the boolean back intoNSUserDefaultsasYES.It’s all of about 4 lines of code: