I have 2 classes, Parent and Child, and Parent has a class method named func. Now I want to get Class instance in func method to distinguish which class is caller.
@interface Parent : NSObject
+ (void)func;
@end
@implementation Parent
+ (void)func {
Class *class = howToGetClass();
NSLog(@"%@ call func", class);
}
@end
@interface Child : Parent
@end
int main() {
[Child func]; // call func from Child
}
Is there any way to get class instance (or class name) in class method?