Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Khanjan

macrumors newbie
Original poster
Jun 25, 2009
14
0
Hey guys,

I have developed this interface using Objective C. Its working well. It has only one .nib file. Now, I need to add a functionality such that when the user starts this application for the first time, there is a prompt to download some databases from the internet. So, how to set up a window which would prompt only when the application starts the first time.

Thanks a lot for all help,

Cheers,
Khanjan
 
I usually just look for a key in the user defaults, and if that key doesn't exist then do the once-only thing, and set a value to that key. Something like this:

Code:
NSString *udKey = @"RunOnce";
if (![[NSUserDefaults standardUserDefaults] objectForKey:udKey]) {
    // open your window
    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:udKey];
}
 
I usually just look for a key in the user defaults, and if that key doesn't exist then do the once-only thing, and set a value to that key. Something like this:

Code:
NSString *udKey = @"RunOnce";
if (![[NSUserDefaults standardUserDefaults] objectForKey:udKey]) {
    // open your window
    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:udKey];
}

I tried that, it didn't quite work ! Ne other suggestions ! :(
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.