Pergunta

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

Perhaps __CLASSNAME__?

Foi útil?

Solução

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

Outras dicas

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

Is

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

What you need?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top