Question

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

Perhaps __CLASSNAME__?

Était-ce utile?

La 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

Autres conseils

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

Is

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

What you need?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top