• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSUserDefaults for another Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSUserDefaults for another Application
      • From: Keith Duncan <email@hidden>
References: 
 >NSUserDefaults for another Application (From: Keith Duncan <email@hidden>)
 >Re: NSUserDefaults for another Application (From: Benjamin Miller <email@hidden>)
 >Re: NSUserDefaults for another Application (From: Keith Duncan <email@hidden>)

  • Prev by Date: Re: Document-based cocoa application with 2 .nibs
  • Next by Date: Re: NSFileManager & hidden folders
  • Previous by thread: Re: NSUserDefaults for another Application
  • Next by thread: Re: NSUserDefaults for another Application
  • Index(es):
    • Date
    • Thread