• 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: Dave DeLong <email@hidden>
  • Date: Sat, 09 Oct 2010 14:28:55 -0600

Of course it is.  Suppose for a minute that [myMutableDictionary allValues] returned a mutable array.  That means that you could add to and remove from this array with impunity.

Except... the objects in this array are supposed to have an associated key.  If you remove an object from the array, then I suppose you could somehow get the dictionary to remove the key as well.  But if you added an object to the array, what would its key be?

That's why the array is immutable.

Dave

On Oct 9, 2010, at 1:59 PM, Trygve Inda wrote:

> [myDict allValues] gets the correct array and works in the table, but it is made immutable.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • RE: NSDictionary allValues not mutable
      • From: Jeff Laing <email@hidden>
    • Re: NSDictionary allValues not mutable
      • From: Trygve Inda <email@hidden>
References: 
 >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