Robin Robin - 5 months ago 9
Objective-C Question

Getting name of the class from an instance in Objective-C

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!

Answer

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