Re: NSDictionary mutability test
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