에서 구문 분석 JSON에서 오류가 나는 테이블에 갈 거예요로 JSON 데이터 및 디스플레이를 시도하고 내 JSON 데이터가이얻기 아이폰
{"isError":false,"ErrorMessage":"","Result":{"Count":4,"Data":[{"ContentID":"127_30_1309793318065","ContentTypeID":1,"UserCaption":"Gandhinagar(Kanjurmarg)","UserComment":"central\n","DateRecorded":"\/Date(1309793318000+0530)\/","Data":"","ShareType":true,"Views":0,"PlayTime},{},{},{}];};isError = 0;}
내가 좋아하는 prasing하고처럼이
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSString *loginStatus = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding];
NSLog(@"%@",loginStatus);
//this is for the getting the data from the server with help of JSON
NSString *json_string = [[NSString alloc] initWithData:webData encoding:NSUTF8StringEncoding];
NSDictionary *result = [json_string JSONValue];
/
//this for holding the Array value which come from the server
NSMutableArray *results = [[NSMutableArray alloc] init];
for (int index = 0; index<[reviewsvalues count]; index++)
{
NSMutableDictionary * value = [reviewsvalues objectAtIndex:index];
ReviewsResult * result = [[ReviewsResult alloc] init];
result.User_Caption = [value objectForKey:@"UserCaption"];
result.ContentType_Id = [value objectForKey:@"DateRecorded"];
result.Average_Rating = [value objectForKey:@"AverageRating"];
//OVER here MY APP GET CRASH
}
}
하지만, 오류가 발생하여 오류가 발생합니다.
[__NSCFDictionary objectAtIndex :] : 인스턴스로 전송 된 인식 할 수없는 선택자
네, 맞습니다.하지만이 NSArray * reviewsArray = [reviewsvalues valueForKey : @ "Data"]; 하지만? 어떻게 셀에 값을 설정하고 어떻게 행 수를 계산할 수 있습니다. – Harish
@Harish : 각 인덱스에서 reviewArray에 사전이 있습니다. –
Stackchat에서 라인 채팅을 할 수 있습니까 – Harish