0
我們在服務器中有一個JSON文件。我們能夠檢索JSON文件,但顯然我們無法獲取嵌套JSON中的項目。如何在Worklight中從調用的適配器中解析JSON字符串
這裏是我們的代碼片段:
- (void)onSuccess:(WLResponse *)response{
NSLog(@"Connection Success: %@",response);
NSString *resultText;
if ([response responseText] != nil) {
resultText = [response responseText];
NSDictionary *allData = [response getResponseJson];
NSDictionary *resultData = allData[@"result"];
...
}
}
下面是我們的JSON文件結構:
{"contacts":[
{
"name":"name 1",
"address":"address 1"
},
{
"name":"name 2",
"address":"address 2"
},
{
"name":"name 3",
"address":"address 3"
}
]}
嗨,我很抱歉的回覆。我們試圖在我們的代碼中實現這一點。不幸的是,我們得到這個錯誤:* [錯誤]工作燈: - [WLClient onInvokeProcedureFailure:userInfo:]:932 * – AWSSET 2014-09-25 06:40:37
您是否解決了此問題WLClient onInvokeProcedureFailure:userInfo:因爲我面對相同 – MichealSmith 2015-12-08 08:30:36