データ型 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
}
],
ありがとう