• 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 mutability test
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary mutability test


  • Subject: Re: NSDictionary mutability test
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 8 Dec 2008 11:11:14 -0700


On Dec 8, 2008, at 10:44 AM, Devon Ferns wrote:

Instead of using exceptions, wouldn't -(BOOL)respondsToSelector: (SEL)aSelector
work if you test for an NSMutableDictionary mutable method?
Or does that not work with class clusters either(can't try it since I'm not at home)


It does not work with class clusters, since NSCFDictionary implements the mutable and immutable methods.

The only method I'm aware of that allows you to tell mutable dictionaries from immutable ones is to use the -classForCoder method. An immutable dictionary will return [NSDictionary class]; a mutable one will return [NSMutableDictionary class].

Nick Zitzmann
<http://www.chronosnet.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


References: 
 >NSDictionary mutability test (From: "email@hidden" <email@hidden>)
 >Re: NSDictionary mutability test (From: "email@hidden" <email@hidden>)
 >Re: NSDictionary mutability test (From: Devon Ferns <email@hidden>)

  • Prev by Date: Weird behavior of mouse location when performing a drag
  • Next by Date: best practice to create Custom Objects represented by a image in a d-n-d operation
  • Previous by thread: Re: NSDictionary mutability test
  • Next by thread: Re: NSDictionary mutability test
  • Index(es):
    • Date
    • Thread