• 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: Forcing NSUserDefaults being written to disk?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing NSUserDefaults being written to disk?


  • Subject: Re: Forcing NSUserDefaults being written to disk?
  • From: Scott Anguish <email@hidden>
  • Date: Thu, 9 Jan 2003 04:18:57 -0500

On Wednesday, January 8, 2003, at 03:51 PM, Pierre-Olivier Latour wrote:

Hi,

I have an application that has no UI. Its settings have to be set by editing
its defaults file (.plist). I use the following code to register the
defaults at startup:

<snip>

My problem is that, even if I call [[NSUserDefaults standardUserDefaults]
synchronize] when application quits (it returns true), no file is written in
~/Library/Preferences/;

According to the doc, it should be written when you call synchronize, even
if no changes have been made to the defaults...


There is likely no domain being specified to use to store the defaults in. Normally this is picked out of the Info.plist key CFBundleIdentifier in the application wrapper.

You need to set the identifier in the target of your application.. unless it is a wrapperless tool.. Instead you're going to have to set the domain programmatically.



PS: I assume synchronize if buggy.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Forcing NSUserDefaults being written to disk?
      • From: Pierre-Olivier Latour <email@hidden>
    • Re: Forcing NSUserDefaults being written to disk?
      • From: Marco Binder <email@hidden>
References: 
 >Forcing NSUserDefaults being written to disk? (From: Pierre-Olivier Latour <email@hidden>)

  • Prev by Date: Re: Aqua Human Interface and Safari
  • Next by Date: Re: "Toll free bridged" types
  • Previous by thread: Re: Forcing NSUserDefaults being written to disk?
  • Next by thread: Re: Forcing NSUserDefaults being written to disk?
  • Index(es):
    • Date
    • Thread