|
|
Default NSUserDefaults
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Is there a non-programatic way to set-up a default NSUserDefaults?
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
I have no idea what that would mean. Please clarify. Do you want to drop an instance of NSUserDefaults on a NSWindow in IB or something? That doesn't make any sense, but I don't think the question does to begin with.
F-bacher
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Feb 2001
Status:
Offline
|
|
He is asking whether there is some plist file you can put in your package where NSUserDefaults looks if it doesn't find a user preferences file.
I think the answer is no, not built in, though you could write your program to look elsewhere (when the defaults returns 0 or whatever). I haven't checked the documentation, though, I could be wrong.
|
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Originally posted by tie:
<STRONG>He is asking whether there is some plist file you can put in your package where NSUserDefaults looks if it doesn't find a user preferences file. </STRONG>
Yes, this is what I was asking.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Why on earth can't you do it programmatically?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Originally posted by Angus_D:
<STRONG>Why on earth can't you do it programmatically?</STRONG>
Streamlined is the word of the day. I would like to keep it separate for clarity.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status:
Offline
|
|
You could add a Defaults.plist (or whatever) file to your app as a resource, and in applicationDidFinishLaunching, find the file via NSBundle, load it into an NSDictionary, and call registerDefaults with that dictionary. Most of the time I'm not sure it adds all that much to just hardcoding the values in the app, but in some situations I could see it. I suppose you could have localized settings this way.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Originally posted by lindberg:
<STRONG>You could add a Defaults.plist (or whatever) file to your app as a resource, and in applicationDidFinishLaunching, find the file via NSBundle, load it into an NSDictionary, and call registerDefaults with that dictionary. Most of the time I'm not sure it adds all that much to just hardcoding the values in the app, but in some situations I could see it. I suppose you could have localized settings this way.</STRONG>
So simple that I overlooked it. Thank you.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
double post
[ 12-18-2001: Message edited by: davecom ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|