isKindOf: for two Class objects
isKindOf: for two Class objects
- Subject: isKindOf: for two Class objects
- From: Jesse Grosjean <email@hidden>
- Date: Fri, 7 Sep 2007 16:28:29 -0400
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. It seems that I need a method
like instancesRespondToSelector:, except I need
instancesAreKindOfClass:.
Any ideas?
Thanks,
Jesse
_______________________________________________
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