Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 28, 2009, 01:02 PM   #1
Khanjan
macrumors newbie
 
Join Date: Jun 2009
Prompt window only when application starts first time

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
Khanjan is offline   0 Reply With Quote
Old Jul 28, 2009, 01:12 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
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];
}
kainjow is offline   0 Reply With Quote
Old Aug 4, 2009, 10:54 AM   #3
Khanjan
Thread Starter
macrumors newbie
 
Join Date: Jun 2009
Quote:
Originally Posted by kainjow View Post
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 !
Khanjan is offline   0 Reply With Quote
Old Aug 4, 2009, 10:57 AM   #4
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Thats fairly vague. Can you post the relevant code?
kainjow is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Can I add a Windows only editing card in Mac Pro?? Cmd-the-World Mac Pro 8 Feb 7, 2011 01:21 PM
Child view doesnot show details when loaded for first time? AbhishekApple iPhone/iPad Programming 0 Sep 9, 2010 04:58 AM
Browser only detects malware the first time m i k e Mac Applications and Mac App Store 1 Apr 3, 2009 12:37 AM
Installing and running Windows in BootCamp for the first time!! budokai140 Mac Basics and Help 0 Oct 22, 2008 03:41 PM
when was the first time u ever used a mac? SilvorX Community 28 Sep 19, 2002 04:41 PM


All times are GMT -5. The time now is 06:10 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC