On the Mac, you can use:
NSString *className = [self className];
or
NSString *className = NSStringFromClass([self class]);
On the iPhone, [self className]
doesn't exist so you'll have to use:
NSString *className = NSStringFromClass([self class]);
NSLog(@"%@",[self className]);
Update: sorry, I didn't realize className didn't exist on the iPhone. As the above comment suggested; use ..
NSLog(@"%@", NSStringFromClass([self class]));
.. instead.
Try:
[[self class] description]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With