NSDictionary - 发送到实例的无法识别的选择器 - 错误
NSDictionary - unrecognized selector sent to instance - Error
我正在尝试解析从 Web 服务返回的 JSON。响应 JSON 看起来像这样 {"API_Count":"17"}
这是我的代码。只是想获取值 (17)。关键值。
这是我的代码.. 'basic' 一定是错误的。我收到错误
**[NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance**
***Any ideas??***
NSData *jsonData = [responseObject dataUsingEncoding:NSUTF8StringEncoding];
NSError *err = nil;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:&err];
for (NSDictionary *item in json )
{
NSObject *val = [item objectForKey:@"API_Count"];
// ERROR !!! [NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance 0xa32b4de1b0d02c49
}
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments 错误:&err];
NSInteger val = [[json objectForKey:@"API_Count"] intergerValue];
我正在尝试解析从 Web 服务返回的 JSON。响应 JSON 看起来像这样 {"API_Count":"17"}
这是我的代码。只是想获取值 (17)。关键值。 这是我的代码.. 'basic' 一定是错误的。我收到错误
**[NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance**
***Any ideas??***
NSData *jsonData = [responseObject dataUsingEncoding:NSUTF8StringEncoding];
NSError *err = nil;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:&err];
for (NSDictionary *item in json )
{
NSObject *val = [item objectForKey:@"API_Count"];
// ERROR !!! [NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance 0xa32b4de1b0d02c49
}
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments 错误:&err];
NSInteger val = [[json objectForKey:@"API_Count"] intergerValue];