json から配列にデータをフェッチしましたが、配列の内容にアクセスすると表示されません カウント 2 レコードで表示されますが、内容は表示されません
for (int i = 0; i<[tempArray count]; i++)
{
id *item = [tempArray objectAtIndex:i];
NSDictionary *dict = (NSDictionary *) item;
ObjectData *theObject =[[ObjectData alloc] init];
[theObject setUser_id:[dict objectForKey:@"user_id"]];
[theObject setSurvey_id:[dict objectForKey:@"survey_id"]];
[theObject setSurvey_title:[dict objectForKey:@"survey_Title"]];
[theObject setSurvey_Description:[dict objectForKey:@"survey_Description"]];
[theObject setDate_Created:[dict objectForKey:@"date_Created"]];
NSString*testing=[dict objectForKey:@"survey_id"];
NSLog(testing);
[surveyList addObject:theObject];
[theObject release];
theObject=nil;
int count =[surveyList count];
NSLog(@"Total is %d",count);
}
のようにアクセスしたいのですが、
ObjectData*data=[surveyList objectAtIndex.path.row];
NSString*cellText=data.surveyDescription;
NSLog の場合、cellText には何も表示されません。配列に内容があるため、なぜそうなのかわかりません。
tempArray: (
{
color = "[UIColor GrayColor]";
"date_created" = "2012-07-24 22:39:14";
"survey_description" = "Survey To get feedback from clients about food quality and any suggestion to improve the service";
"survey_id" = 1;
"survey_title" = "Resturant Survey";
"user_id" = ali40;
},
{
color = "[UIColor greyColor]";
"date_created" = "2012-07-25 00:43:42";
"survey_description" = "Toursim Survey";
"survey_id" = 2;
"survey_title" = "Travel Servey";
"user_id" = ali40;
}
)