Re: object type testing
Re: object type testing
- Subject: Re: object type testing
- From: Andy Lee <email@hidden>
- Date: Sun, 7 May 2006 14:18:47 -0400
On May 7, 2006, at 12:56 PM, Lawrence Sanbourne wrote:
On 5/7/06, Ben Dougall <email@hidden> wrote:
Todd, thanks for the reply.
On Sunday, May 7, 2006, at 05:03 pm, Todd Blanchard wrote:
> isKindOfClass: I think tests to see if you are a subclass of a
given
> class. Its what I have used before.
i'm not after subclasses though -- just is of a particular type or
not. [...]
-isKindOfClass: actually returns YES if the object is a member of the
given class or is a subclass of the given class. This is probably the
behavior you want,
Ben specifically said he doesn't want the -isKindOfClass: test, and
the code options in his original message are consistent with this.
Since we don't know what the context is, we don't have enough
information to second-guess.
*Assuming* specific class membership is the desired test, offhand I
would use -isMemberOfClass: instead of comparing class objects, just
because I think it reads better, but I doubt it makes any practical
difference. Conceivably for debugging it might be useful to break on
-isMemberOfClass:, or replace it via +poseAsClass:, but if your
situation is very simple it probably doesn't matter.
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden