Вопрос

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

Perhaps __CLASSNAME__?

Это было полезно?

Решение

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

Другие советы

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

Is

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

What you need?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top