【发布时间】:2013-02-06 11:52:09
【问题描述】:
{
ErrorCodes = (
12
);
Success=0;
}
我有像上面这样的 json 响应,我想从错误代码中获取 12,以便我可以显示适当的错误消息。我就是这样的
NSInteger err = [[dict objectForKey:@"ErrorCodes"] integerValue];
但这会产生异常错误
[__NSArrayM integerValue]: unrecognized selector sent to instance
我做错了什么?以及如何将错误代码 12 转换为 NSInteger...
【问题讨论】:
-
一次又一次。解析来自 JSON 和无法识别的选择器的数据。