Question

Is there any way to get the current class name via a compile time macro like __PRETTY_FUNCTION__?

Perhaps __CLASSNAME__?

Was it helpful?

Solution

Not that I am aware of. However, when you follow the usual pattern of having one .h and .m file for each class, then you may find the __FILE__ macro useful. See http://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html

OTHER TIPS

You want the name of a class or do I misunderstand?

Is

NSString *s =  NSStringFromClass([myInstance class]);

What you need?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top