• 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: "M. Uli Kusterer" <email@hidden>
  • Date: Fri, 22 Oct 2004 03:28:08 +0200

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". NSUserDefaults uses CFPreferences under the hood, and the CFPreferences docs say (on CFPreferencesCopyValue and all other functions that return objects from the preferences):

Note that values returned from this function are immutable,
even if you have recently set the value using a mutable object.

according to <http://developer.apple.com/documentation/CoreFoundation/Reference/CFPreferencesUtils/Reference/FunctionGroupIndex.html#//apple_ref/doc/uid/20001450/F11065>

So, I think the only bug worth filing will probably be against the docs, because the docs for NSUserDefaults -objectForKey: don't really mention this at all.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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: Uli Zappe <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>)

  • Prev by Date: confused about framework headers
  • Next by Date: Re: NSMutableArray & Pointers
  • 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