You can subclass MKNetworkOperation and override the responseJSON method with the following:
-(id) responseJSON { NSString *rawJSON; id jsonValue = nil; if ((rawJSON = [[NSString alloc] initWithData:[self responseData] encoding:NSUTF8StringEncoding]) != nil) { SBJsonParser *jsonParser = [[SBJsonParser alloc] init]; if ((jsonValue = [jsonParser objectWithString:rawJSON]) == nil) { NSLog(@"This string doesn't seem to be JSON: '%@'\nraw Data : '%s'", rawJSON, (char *)[[self responseData] bytes]); return [self responseString]; } } else { NSLog(@"This data doesn't seem to be an UTF8 encoded string: %@", [self responseData]); return [self responseString]; } return jsonValue; }
source share