So you got some desktop Cocoa code to port that does some introspection, like
if ([[args className] isEqualToString:@"NSCFBoolean"])
and you noticed — whoops! — that -className doesn’t exist in the iPhone SDK, for no apparent reason other than to confuse you?
Well, no, neither did we until today. But if/when you do … here’s the trick to faking it yourself:
#import <objc/runtime.h>
- (NSString *)className
{
return [NSString stringWithUTF8String:class_getName([self class])];
}
Now you know!
4
OCT
OCT
3
Share