Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how do I determine if this is the first time the app is launched?



That is exactly what registerDefaults: is for.
Just make a dictionary with the defaults you want and register them with [[NSUserDefaults standardUserDefaults] registerDefaults:yourDefaults] at some point early in the app's lifetime.


If they already exist, it does not modify the existing values. See <file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/ Conceptual/UserDefaults/index.htmll>

On Jun 24, 2006, at 3:53 PM, Alan Smith wrote:

I tried checking if the preference file existed but apparently but by
the time it awakeFromNib it is there. I need to add some things to the
defaults so that the rest of my app can use them. I also don't want to
overwrite them every time is launches, that would defeat the purpose.

Thanks, Alan
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"Don't waste your life doing things others have already done."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/adam% 40caffeinatedcocoa.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >how do I determine if this is the first time the app is launched? (From: "Alan Smith" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.