我從json獲取數據。它工作正常,但問題是數據不顯示在tableView中。數據沒有顯示在iphone tableView
我檢查了使用NSLog分配給單元格的值,但單元格不顯示任何數據。
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
int count = [surveyList count];
NSLog(@"These are rows %d",count);
return [surveyList count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
ObjectData *data = [surveyList objectAtIndex:indexPath.row];
NSString *testingClient = data.survey_title;
NSLog(testingClient);
NSString *cellText = testingClient;
return cell;
}
確保分配委託給你的表視圖, – DivineDesert 2012-07-27 04:25:03
是的,我已經指派delagate有人告訴tableviewrealod數據創建類似的問題,但我還沒有重新加載任何東西 – user1553768 2012-07-27 04:28:18