2 ms·
JSONObjectWithData can return an NSArray or an NSDictionary in the general case, and a NSString, NSNull or NSNumber if you direct it to allow fragments. It can
by alextgordon 12y ago
JSONObjectWithData can return an NSArray or an NSDictionary in the general case, and a NSString, NSNull or NSNumber if you direct it to allow fragments. It can also return nil.
So aside from being verbosely named, it's also incorrectly named.
If they'd called it [NSJSON parseData:] you wouldn't have been confused.