我在JSONkit.h
使用中遇到问题NSDictionary
。使用它的正确方法是什么?
杰森:
[{"id":"1100","name":"John Stuart"}]
代码:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSDictionary *jsonData = [responseData objectFromJSONData];
NSString *name = [jsonData objectForKey:@"name"];
NSLog(@"Name: %@", name);
}
错误:
** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[JKArray objectForKey:]: unrecognized selector sent to instance 0x84b9b30'