• 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: Determining whether a dictionary is mutable or not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining whether a dictionary is mutable or not


  • Subject: Re: Determining whether a dictionary is mutable or not
  • From: "email@hidden" <email@hidden>
  • Date: Fri, 14 Jan 2011 11:34:55 +0000


On 14 Jan 2011, at 11:25, Tito Ciuro wrote:

> Hi Mike,
>
> Given that the caller can pass a NSDictionary or an NSMutableDictionary, I wanted to test its mutability before calling setObject:forKey:. In order to avoid calling mutableCopy each time, I thought it would be more efficient to test it and then call mutableCopy only when needed.
>
> Thanks for the help,
>
> -- Tito
>
>


In this case just check if your object responds to setObject:forKey:
If it does its mutable, if not it isn't.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com_______________________________________________

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: Determining whether a dictionary is mutable or not
      • From: Clark Cox <email@hidden>
    • Re: Determining whether a dictionary is mutable or not
      • From: Tito Ciuro <email@hidden>
References: 
 >Determining whether a dictionary is mutable or not (From: Tito Ciuro <email@hidden>)
 >Re: Determining whether a dictionary is mutable or not (From: Mike Abdullah <email@hidden>)
 >Re: Determining whether a dictionary is mutable or not (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Re: Determining whether a dictionary is mutable or not
  • Next by Date: Re: Determining whether a dictionary is mutable or not
  • Previous by thread: Re: Determining whether a dictionary is mutable or not
  • Next by thread: Re: Determining whether a dictionary is mutable or not
  • Index(es):
    • Date
    • Thread