0
JSON 구조와 관련되어 있으므로 도움이 필요한 데이터 형식 NSDictionary에 대해서는 약간 혼란 스럽습니다.xcode 및 NSDictionary (objectForKey 및 valueForKey)에서 데이터 값 추출
이 모든 것은 사전 및 objectForKey입니다{
"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
}
],
},
}
이제 내 이해한다 : 여기 내 JSON 출력은 @ "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
}
],
감사
감사합니다. 괜찮 았어. 하지만 내가 갈 수있는 곳이 objectForKey를 이해하고 JSON 출력 맵을 이해하는 데 도움을 얻을 수 있는지 여부입니다. – user1509593
이 경우 실제로 JSON으로 작업하지 않습니다. JSON은 이미 비 직렬화되었으며 [NSArray] (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html) 또는 [NSDictionary] (https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html). 그렇지 않으면 작업중인 JSON 라이브러리에 대한 설명서를 참조하는 것이 좋습니다. [SBJson] (http://stig.github.com/json-framework/) – stephenmuss
감사합니다. 알았다. 나는 JSON 라이브러리를 참조 할 것이다. – user1509593