Re: isKindOf: for two Class objects
Re: isKindOf: for two Class objects
- Subject: Re: isKindOf: for two Class objects
- From: "Clark Cox" <email@hidden>
- Date: Fri, 7 Sep 2007 13:56:09 -0700
On 9/7/07, Jesse Grosjean <email@hidden> wrote:
> I have two Class objects and I want to see if one of them isKindOf:
> the other. I started off with this code, but the test always fails:
>
> Class arrayClass1 = [NSArray class];
> Class arrayClass2 = [NSArray class];
>
> if ([arrayClass1 isKindOfClass:arrayClass2]) {
> NSLog(@"Success");
> } else {
> NSLog(@"Fail");
> }
>
> I can see why, since Class's must be their own thing, but I still
> can't figure a good way to do my test.
Is this what you're looking for: [arrayClass1 isSubclassOfClass: arrayClass2]?
--
Clark S. Cox III
email@hidden
_______________________________________________
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