For the class:
NSStringFromClass([self class]);
For methods (assuming you are in the method you are interested in):
NSStringFromSelector(_cmd);
Side note, _cmd
is passed just like self
to every method in Objective C and is a SEL (selector) for the method you are in.