• 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: Bug in NSArrayController? (immutable instead of mutable dictionaries)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: Bug in NSArrayController? (immutable instead of mutable dictionaries)
  • From: Uli Zappe <email@hidden>
  • Date: Fri, 22 Oct 2004 03:50:50 +0200

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:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Bug in NSArrayController? (immutable instead of mutable dictionaries)
      • From: "M. Uli Kusterer" <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>)

  • Prev by Date: Re: How do you create a NSTabViewItem containing NSImageView programmatically? I almost got it...
  • Next by Date: Re: Fast direct pixel access
  • Previous by thread: Re: Bug in NSArrayController? (immutable instead of mutable dictionaries)
  • Next by thread: Re: Bug in NSArrayController? (immutable instead of mutable dictionaries)
  • Index(es):
    • Date
    • Thread