• 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
NSUserDefaults and the synchronize: method - doesn't seem to sync...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUserDefaults and the synchronize: method - doesn't seem to sync...


  • Subject: NSUserDefaults and the synchronize: method - doesn't seem to sync...
  • From: Diggory Laycock <email@hidden>
  • Date: Sun, 2 Dec 2001 15:17:08 +0000

I'm writing an object that interacts with the Internet Config defaults (found in the file com.apple.internetconfig.plist)

I have got the standardUserDefaults object and have used persistentDomainForName:
to get an NSMutableDictionary (internetDefaults) that represents the propertylist.

I can extract info from this dictionary fine, but when I change an object deep in the dictionary this change doesn't seem to pass into the actual defaults system (or the plist file).

The change doesn't seem to pass into the file even if i pass the synchronize:
message to the standardDefaults object (which the docs seem to suggest isn'
t even necessary.)


<from the NSUserDefaults docs:>

synchronize

- (BOOL)synchronize

Saves any modifications to the persistent domains and updates all persistent domains that were not modified to what is on disk. Returns NO if it could not save data to disk. Because synchronize is automatically invoked at periodic intervals, use this method only if you cannot wait for the automatic synchronization (for example, if your application is about to exit), or if you want to update user defaults to what is on disk even though you have not made any changes.

</from the NSUserDefaults docs:>


Am I wrong in assuming that changes made to internetDefaults (the dictionary returned by the persistentDomainForName: method) are automatically are copied to file?

Diggory Laycock - MonkeyFood.com


  • Follow-Ups:
    • Re: NSUserDefaults and the synchronize: method - doesn't seem to sync...
      • From: Chris Parker <email@hidden>
    • Re: NSUserDefaults and the synchronize: method - doesn't seem to sync...
      • From: Andreas Monitzer <email@hidden>
  • Prev by Date: Re: Newbie
  • Next by Date: Re: NSUserDefaults and the synchronize: method - doesn't seem to sync...
  • Previous by thread: [SOLVED but...] Re: awakeFromNib called twice !
  • Next by thread: Re: NSUserDefaults and the synchronize: method - doesn't seem to sync...
  • Index(es):
    • Date
    • Thread