| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
At 17:37 Uhr -0400 21.10.2004, Brent Gulanowski wrote:I figured it out.
If you turn off immediate saving with a -[NSUserDefaultsController
setSavesImmediately:] with a "NO" argument, the array members behave
like mutable dictionaries. This is a *very strange* side effect.
I could see how this would work:
If "immediate saving" is on, NSUserDefaultsController probably directly writes to NSUserDefaults. NSUserDefaults is only defined to return immutable objects. Sometimes it happens to return mutable ones, but that's an implementation detail you can't rely on.
So, when you change something, it turns immutable, because next time you access an item, it is re-fetched from NSUserDefaults.
OTOH, when "immediate saving" is off, it obviously means NSUserDefaultsController has to keep a copy of the current values until you've finished with them and they're saved. This copy will obviously be in accordance with the settings you specified.
| References: | |
| >Array of dictionaries + NSUserDefaultsController (From: Brent Gulanowski <email@hidden>) | |
| >Re: Array of dictionaries + NSUserDefaultsController (From: Brent Gulanowski <email@hidden>) | |
| >Re: Array of dictionaries + NSUserDefaultsController (From: "M. Uli Kusterer" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.