During a JSON parsing (done with AFNetwork json getter), I have this snippet of code:
if (![[data class] isKindOfClass:[NSDictionary class]]) {
DLog(@"%@ was not kind of class NSDictionary",[data class]);
return;
}
But for some reasons, the If sentence becomes true, and the function returns:
> __NSCFDictionary was not kind of class NSDictionary
But shouldn’t __NSCFDictionary be specifically kind of class NSDictionary? or if this is the wrong way of validating, how do I do it then ?
UPDATE :
I tried turning it around, like so :
if (![[NSDictionary class] isKindOfClass:[data class]]) {
DLog(@"%@ was not kind of class NSDictionary",[data class]);
return;
}
Still doesn’t work:
__NSCFDictionary was not kind of class NSDictionary
According to docs
You are using
which will return a string.. you have to use the object/instance only i.e