Re: NSUserDefaults for another Application
Re: NSUserDefaults for another Application
- Subject: Re: NSUserDefaults for another Application
- From: Michael Nickerson <email@hidden>
- Date: Thu, 26 Jul 2007 12:44:17 -0400
On Jul 26, 2007, at 6:03 AM, Keith Duncan wrote:
I could do that but it would be a lot of code to load and save
every value in the preference file.
I have tried using NSUserDefaults to get the
persistentDomainForName using the bundle id which works fine for
loading the prefs, but when it comes to saving the prefs with
setPersistentDomain:forName: it doesn't.
Say I have a key-object pair present in the dictionary after
loading it and I remove that object at runtime, when saving the
preference dictionary using setPersistentDomain:forName: the key-
object pair remains in the preference file. I assume that my own
alloc'd NSUserDefaults objects also register for the application
termination notification and synchronize then without being
explicitly told to?
Call -synchronize after calling -setPersistentDomain:forName: and it
should work as you expect.
--------------------------------------
Darkshadow
(aka Michael Nickerson)
http://www.nightproductions.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden