On Dec 8, 2008, at 2:59 PM, Michael Ash wrote:
On Mon, Dec 8, 2008 at 12:29 PM, Charles Steinman
<[EMAIL PROTECTED]> wrote:
This is explained in the thread you referenced. All NSDictionary
objects are instances of NSCFDictionary. Thus the only way to check
if they are mutable through public API is to try mutating them and
see if Cocoa throws a hissy fit.
You can use -classForCoder and that will give you either NSDictionary
or NSMutableDictionary. This is a public API but the result is not
documented to be useful in this manner, so don't use this in any
shipping app. (Although given the need for archives to remain
backwards compatible I would not expect it to ever change.) However it
could be handy for debugging purposes.
To add to this, a framework may choose to implement a custom
NSDictionary/NSMutableDictionary subclass and hand an instance of it
back out through an NSDictionary * typed pointer. A classForCoder
method on a custom subclass like this might not return NSDictionary or
NSMutableDictionary.
Jon Hess
Mike
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/jhess%40apple.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]