NSUserDefaults and the synchronize: method - doesn't seem to sync...
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