Parts from the response:
No. That's not part of the response. That's the description of the resulting NSDictionary
which is NOT JSON.
NSLog([dict objectForKey:@"avg_rating"]);
fails withNSInvalidArgumentException
, whileNSLog([dict objectForKey:@"country"]);
would work.
Sure, because NSLog()
ain't no magic. It expects a (format) string as its first argument, so if the object you feed it is an NSString
, it will work fine (country
is a string, I assume), but if you don't (avg_rating
may be an NSNumber
), then it won't (it will try to send the messages of NSString
to the NSNumber
instance, which obviously fails).
So understand the difference between JSON and the description of the NSDictionary
generated from that JSON.