안녕하세요 친구 저는 uitableview에 json 파일을 구문 분석하는 데 문제가 있습니다. 내 JSON 파일은 다음과 같습니다uitable보기에서 json 파일을 구문 분석 할 수 없습니다.
[
{
"id": 1,
"type": "Deal Closed",
"score": 100,
"createdAt": "2014-10-03T08:10:10.000Z",
"updatedAt": "2014-10-03T08:10:10.000Z"
},
{
"id": 2,
"type": "Followers",
"score": 10,
"createdAt": "2014-10-03T08:10:28.000Z",
"updatedAt": "2014-10-03T08:10:28.000Z"
}
]
내 코딩이 여기에있다 ..
static NSString *CellIdentifier = @"Leader";
NSString *firstname = [[promoArray objectAtIndex:indexPath.row] objectForKey:@"type"];
NSString *lastname = [[promoArray objectAtIndex:indexPath.row] objectForKey:@"score"];
cell.lblPrice.text=[jsonDict valueForKey:@"type"];
cell.lblDesc.text=[jsonDict valueForKey:@"score"];
이 exception..while 분석을 던졌습니다. 내가 json 파일에서 Uitable보기 유형 및 점수를 구문 분석해야합니다.
1. 이것은 구문 분석이 아니라 배열이나 사전에서 항목에 액세스하는 것입니다. 2.'firstname'과'lastname'은 결코 사용되지 않습니다. 3. 어떤 라인이 예외를 생성하고 오류 메시지가 발생합니까? 이미 전역 예외 중단 점이 없으면 추가하십시오. – zaph