Chatar Veer Suthar
Chatar Veer Suthar

Reputation: 15639

Is there any way to identify that my app is executing first time on iphone?

I want to show a message of instructions when user first time use my application, but then never until he won't delete it and re-download,,,

one easy way is to save some value in sqlite3 database and match it, but I want to use something else,,,,

Upvotes: 0

Views: 94

Answers (3)

gd1
gd1

Reputation: 11413

You can do anything the other answerers suggested, or just check for a certain file (call it firstrun.txt) under app "Documents" directory to exist at startup.

If it doesn't exist, show the welcome message and create it, otherwise, do nothing. When the user updates the app, the "Documents" directory doesn't get emptied.

That's it.

Upvotes: 1

Rakesh Bhatt
Rakesh Bhatt

Reputation: 4606

you ca use sqlite or plist or [NSUserDefaults standardUserDefaults] for saving value.

Upvotes: 0

conmulligan
conmulligan

Reputation: 7148

I'd use NSUserDefaults:

if ([[NSUserDefaults standardUserDefaults] boolForKey:kHasRun] == NO) { 

    // do something

    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kHasRun];
}

Upvotes: 1

Related Questions