Re: Where to set default user defaults?
Re: Where to set default user defaults?
- Subject: Re: Where to set default user defaults?
- From: Marten van Gelderen <email@hidden>
- Date: Sat, 22 Nov 2003 11:16:35 +0100
Hallo,
Read: "Cocoa programming for Mac OS X" by Aaron Hillegas, Addison
Wesley, ISBN: 0-201-72683-1, chapter 8 on "User Defaults" and
specifically page 161.
According to his scheme, I created a separate class "AppController"
which is connected to the "Preferences..." menu item. In that class I
used the +(void)initialize class method, which is sent before any other
message, to initialize my app's defaults, first in "body" of the
+(void)initialize method itself the factory defaults and then I modify
them from a bundle resource XML file to the current app's defaults
(that XML file is editable and as such can modify the app's default
behaviour without recompiling). Next in my document class (or
preference controller class) in either -(id)init or -(void)awakeFromNib
I can query those defaults.
If you like I can send you an excerpt of my code (which still more or
less resembles Aaron's code in his book).
On 21 Nov 2003, at 2:38 PM, John Timmer wrote:
I know there's been some discussion in the past about what the order of
"wakeFromNib" calling is (and the answer seems to be "none is
guaranteed").
A related question that I couldn't find in the archives - are all the
"init"
methods called before all the "awakeFromNib" methods?
The reason I'm asking is that I want to set some default user defaults
for
the first time the app launches, and I'm going to need some of them
before
the application's interface gets displayed. So, in short, I need to
have
something that's called first during the app launching process.
Thanks,
JT
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
Groeten, Marten
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.