isKindOfClass:
isKindOfClass:
- Subject: isKindOfClass:
- From: Kevin Callahan <email@hidden>
- Date: Sat, 08 May 2010 12:51:03 -0700
isKindOfClass: is an instance method and doesn't work on a class you get from NSClassFromString().
Apple docs: 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.
for example, you can't do this:
Class classFromString = NSClassFromString(string);
[classFromString isKindOfClass:[SomeClass class]];
I don't want to instantiate classFromString in order to check if it's a subclass of SomeClass.
What's the best way to check for class inheritance without instantiating?
Thanks
Kevin
_______________________________________________
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