• 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: NSDictionary allValues not mutable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary allValues not mutable


  • Subject: Re: NSDictionary allValues not mutable
  • From: Mike Abdullah <email@hidden>
  • Date: Sat, 9 Oct 2010 21:15:24 +0100

On 9 Oct 2010, at 21:06, Trygve Inda wrote:

>> I have an NSMutableDictionary made from a plist with
>> CFPropertyListCreateDeepCopy so that all leaves and containers are mutable.
>>
>> In this plist is an dict whose values I want to move into a mutable array to
>> be displayed and edited in an NSTable.
>>
>> [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.
>>
>> Trygve
>
> PS: I do not want to use mutableCopy because I want to objects in the array
> and the objects in the dictionary to refer to the same objects... Eg I do
> not want two of each object.

Copying a collection/container class does not automatically copy the content objects too._______________________________________________

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

References: 
 >Re: NSDictionary allValues not mutable (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: NSDictionary allValues not mutable
  • Next by Date: Re: NSDictionary allValues not mutable
  • Previous by thread: Re: NSDictionary allValues not mutable
  • Next by thread: Re: NSDictionary allValues not mutable
  • Index(es):
    • Date
    • Thread