【发布时间】:2012-12-24 09:00:32
【问题描述】:
你们所有人……这可能是一个愚蠢的问题,但我是 iOS 新手……我需要我们的帮助…… 我正在做 Json 解析..获取一些值..我的 json 响应是:-
{
"_id" = 6001256351188711607;
"access_level" = private;
createdOn = "2012-12-17T07:06:42.09000";
"created_by" = 9514682679942790960941872227340;
description = "";
keywords = "";
location = (
"12.000023",
"77.000012"
);
picture = "http://54120127762218290878972982207449539830674.jpg";
"rel_interests" = (
);
source = "Bank";
"source_url" = "";
title = ipl;
},
);
"location_description" = "";
picture = "http://54252499650705298384658551818639.jpg";
"rel_interests" = (
);
source = "";
"source_url" = "";
title = "Air";
}
我通过使用此代码获得标题:-
[titleArray addObject:[[_arrData objectAtIndex:j]valueForKey:@"title"]];
但是当我为位置执行此操作时,我会抛出异常......我怎样才能获得位置? 请帮助我实现这一目标...
【问题讨论】:
-
您的“JSON”响应实际上不是 JSON。
title = Watch; location = ( "12.000000", "77.000000" );是 NSLogging 一个 NSDictionary 的结果吗? -
这个 JSON 应该是
location={"12","77"}。检查 json.org -
另外,
_arrData是什么?有什么例外?您需要提供异常堆栈跟踪。 -
@tom "location": [12.984805, 77.618312] 是我的 json 响应...
-
另外,
location中的条目不是整数,而是浮点数。
标签: objective-c