我正在尝试将我的 JSON 放入 NSDictionary
中。我正在做以下事情:
NSData *innerData = [json objectForKey:@"data"];
NSLog(@"Inner Description %@", innerData);
NSError* error;
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:innerData
options:kNilOptions
error:&error];
NSLog(@"dict: %@",json);
它在创建字典时一直崩溃并出现此错误。
-[__NSCFDictionary bytes]: unrecognized selector sent to instance 0x1e8d6100
有人能帮忙吗?
最佳答案
innerData 在运行时是一个 NSDictionary,而不是你期望的 NSData。
关于objective-c - 无法将 JSON 放入 NSDictionary,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14071341/