Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in NSArrayController? (immutable instead of mutable dictionaries)



Am 22.10.2004 um 03:28 schrieb M. Uli Kusterer:

At 2:59 Uhr +0200 22.10.2004, Uli Zappe wrote:
4. The above only happens as long as appliesImmediately is set to YES in NSUserDefaultsController. If it is set to NO, NSUserDefaultsController always returns mutable dictionaries. However, this is no workaround for the creation of new mutable dictionaries, because as soon as as appliesImmediately is set back to YES to enable saving the preference settings to disk, NSUserDefaultsController sends an *immutable* dictionary to NSArrayController, thus changing the mutable to an immutable dictionary.

I'll file a bug report.

You'll very likely get back "behaves as designed".

Well, it doesn't in that NSUserDefaultsController does *not* always return immutable objects; in fact, most of the time it does return mutable objects. It's only that you can't create them in the first place. Once you have dealt with that (e.g. restarted your app with a now existing preferences plist), it works.

So the most important point IMHO is consistency of behavior. If it consistently returns immutable objects, I won't like it, but at least it would be consistent.

Apart from that, wanting to store sets of preferences in an array and in the user defaults system at the same time is such an obvious application for Bindings that it should be possible to do this without all this hassle. If Apple really decides to make immutable the consistent behavior, then at least they should provide a factory NSImmutableToMutableTransformer.

Bye
Uli
________________________________________________________

Uli Zappe, Solmsstraße 5, D-65189 Wiesbaden, Germany
http://www.ritual.org
Fon: +49-700-ULIZAPPE
Fax: +49-700-ZAPPEFAX
________________________________________________________

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Bug in NSArrayController? (immutable instead of mutable dictionaries) (From: Uli Zappe <email@hidden>)
 >Re: Bug in NSArrayController? (immutable instead of mutable dictionaries) (From: Brent Gulanowski <email@hidden>)
 >Re: Bug in NSArrayController? (immutable instead of mutable dictionaries) (From: Uli Zappe <email@hidden>)
 >Re: Bug in NSArrayController? (immutable instead of mutable dictionaries) (From: Uli Zappe <email@hidden>)
 >Re: Bug in NSArrayController? (immutable instead of mutable dictionaries) (From: Uli Zappe <email@hidden>)
 >Re: Bug in NSArrayController? (immutable instead of mutable dictionaries) (From: "M. Uli Kusterer" <email@hidden>)



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.