Re: No sure way to tell whether an array is mutable?
Re: No sure way to tell whether an array is mutable?
- Subject: Re: No sure way to tell whether an array is mutable?
- From: Kenny Leung <email@hidden>
- Date: Thu, 25 Jan 2007 18:38:57 -0800
isMemberOfClass is unlikely to work for Foundation class clusters
because it tests for an instance actually being of a certain class.
isKindOfClass "Returns a Boolean value that indicates whether the
receiver is an instance of given class or an instance of any class
that inherits from that class."
So I have an instance of a class that purports to be a NSMutableArray
or one of its subclasses, but is not actually mutable.
-Kenny
On Jan 25, 2007, at 6:32 PM, Chas Spillar wrote:
I think you need isMemberOfClass: as in:
If ([newChildren isMemberOfClass:[NSMutableArray class]) {
...
Is seem to remember there is some complexity about them being class
clusters, but I don't remember exactly...
Chas.
From: Kenny Leung <email@hidden>
Date: Thu, 25 Jan 2007 18:21:16 -0800
To: Apple Cocoa List <email@hidden>
Subject: No sure way to tell whether an array is mutable?
if ( [newChildren isKindOfClass:[NSMutableArray class]] ) {
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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