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

Similar Threads
thread Thread Starter Forum Replies Last Post
Quit application when closing last window? anarchopath OS X 8 Mar 13, 2013 07:45 PM
Show Window without activating (keep application below it active) wesleyh Mac Programming 0 Feb 26, 2013 04:08 AM
Adding Application to Login-Window dabizkitman OS X 10.8 Mountain Lion 5 Jan 17, 2013 07:31 AM
Time Machine starts from scratch?? mpts OS X 10.8 Mountain Lion 1 Oct 15, 2012 03:45 PM
Application window size issue(s) derek.fulmer Mac OS X 10.7 Lion 0 Aug 8, 2012 10:48 AM

Forum Jump

All times are GMT -5. The time now is 03:36 PM.

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

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