Re: NSDictionary allValues not mutable
Re: NSDictionary allValues not mutable
- Subject: Re: NSDictionary allValues not mutable
- From: Uli Kusterer <email@hidden>
- Date: Tue, 19 Oct 2010 23:41:53 +0200
On 09.10.2010, at 21:59, Trygve Inda wrote:
> [myDict allValues] gets the correct array and works in the table, but it is
> made immutable. Is there any better way to keep the mutability other than
> using allKeys then stepping through each one, obtaining its object and
> adding it to an NSMutableArray that I made with alloc/init?
> Why doesn't allValues simply preserve the mutability? I would have guessed
> that internally it did the above steps.
There is no "keep the mutability". An NSDictionary probably doesn't even use an array internally to store its values. It probably uses some kind of tree data structure or whatever. The array is very likely created specially for you when you call allValues.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://groups.yahoo.com/group/mac-gui-dev/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden