views:

114

answers:

2

Hi everyone

I have the following problem: I get an instance of a class passed and want to know the name of the class of this instance. Any guess how to get this?

Thank you very much!

+5  A: 

NSStringFromClass([instance class]) should do the trick.

CiNN
+5  A: 

if all you want to do is test an object to see if it's a type of a certain Class

BOOL test = [self isKindOfClass:[SomeClass class]];
kubi
Thanks, I will use this :)
Robin
Upvoted for anticipating the need rather than just answering the question.
Kendall Helmstetter Gelner