我对数据类型 NSDictionary 有点困惑,因为它与 JSON 结构有关并且需要帮助。这是我的 JSON 输出:
{
"requestDetails":
{
"timeStamp":"2001-12-17T09:30:47-08:00",
"transactionType":"QUERY",
"action":"GET INVOICES",
},
"Payload":
{
"event":
{
"sourceRecordType":"INVOICE INQUIRY",
"serviceRecordType":"INVOICE",
"ownershipType":"EXPLICIT",
},
},
"executionDetails":
{
"timeStamp":"2012-12-04T13:48:21-08:00",
"statusType": "SUCCESSFUL_TRANSACTION",
"statusCode":"0",
"DBRecordCount":"0",
"processedRecordCount":"0",
"warning":
[
{
"errorCode":"257",
"errorDescription":"Criteria specified is incorrect. Please Verify that the criteria is correct.",
"__hashCodeCalc":false
},
{ "errorCode":"60",
"errorDescription":"No results were found. Please enter new search criteria.",
"__hashCodeCalc":false
}
],
},
}
现在我的理解是这整件事是字典和 objectForKey:@"executionDetails" 将给出以下输出:
{
"timeStamp":"2012-12-04T13:48:21-08:00",
"statusType": "SUCCESSFUL_TRANSACTION",
"statusCode":"0",
"DBRecordCount":"0",
"processedRecordCount":"0",
"warning":
[
{
"errorCode":"257",
"errorDescription":"Criteria specified is incorrect. Please Verify that the criteria is correct.",
"__hashCodeCalc":false
},
{ "errorCode":"60",
"errorDescription":"No results were found. Please enter new search criteria.",
"__hashCodeCalc":false
}
],
}
如何在 [] 括号内选择值。我尝试了 valueForKey 和 ObjectForKey。我不清楚处理结构并感谢帮助
warning":
[
{
"errorCode":"257",
"errorDescription":"Criteria specified is incorrect. Please Verify that the criteria is correct.",
"__hashCodeCalc":false
},
{ "errorCode":"60",
"errorDescription":"No results were found. Please enter new search criteria.",
"__hashCodeCalc":false
}
],
谢谢