If you are on Mac OS X, you can use [object className], it returns NSString
for(id obj in array) NSLog(@"Name of the class: %@", [obj className]);
To check if this is an NSString, you should use something like this:
for(id obj in array) {
if ([obj isKindofClass:[NSString class]]) {
}
}
source
share