diyora Posted August 18, 2008 Share Posted August 18, 2008 Hello, I want to know the object type in cocoa. Suppose object (id) is consider in which i store string,int,etc.. But i want to know the type of (id). Thank you... Link to comment Share on other sites More sharing options...
bofors Posted August 18, 2008 Share Posted August 18, 2008 id object = [NSMutableString new]; // TRUE: if([[object class] isKindOfClass:[NSString class]]) NSLog(@"True"); // FALSE if([[object class] isMemberOfClass:[NSString class]]) NSLog(@"False"); See this: http://developer.apple.com/documentation/C...3-CH11-BAJCDADF You can also get the className string for Class object using an Obj-C runtime function: const char *className = class_getName(Class); Link to comment Share on other sites More sharing options...
Recommended Posts