Hi, I have following piece of code
NSMutableArray *mutArray = [[NSMutableArray alloc] init];
[mutArray addObject: [NSProcessInfo processInfo]];
[mutArray addObject: @"This is NSString Object"];
[mutArray addObject: [[NSMutableString alloc] initWithString: @"1st Mutable String"]];
for (id element in mutArray){
NSLog(@" ");
NSLog(@"Class Name: %@", [element className]);
NSLog(@"Is Member of NSString: %@", ([element class] isMemberOfClass: [NSString class]) ? YES: NO);
NSLog(@"Is kind of NSString: %@", ([element class] isKindOfClass: [NSString class]) ? YES: NO);
}
I am getting following output (and expecting as pointed)
Class Name: NSProcessInfo
Is Member of NSString: NO
Is Kind of NSString: NO
Class Name: NSCFString <-- Expecting NSString
Is Member of NSString: NO <-- Expecting YES
Is Kind of NSString: NO <-- Expecting YES
Class Name: NSCFString <-- Expecting NSMutableString
Is Member of NSString: NO
Is Kind of NSString: NO <-- Expecting YES
Am I missing something terrible simple here? Thanks!