Robin Robin - 1 year ago 63
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download