我正在开发一个ipad应用程序。在这个应用程序中,我有两个部分-一个显示像网格视图和其他表视图的画廊。我的gridview工作成功。
当我实现tableview,它全屏与指定的行高和bgcolor。但是数据没有显示在tableview上。我正在从plist收集数据。
我设计了tableviewcell以样式显示每一行。但是tableviewcell设计不能在tableview中工作。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"categoryCell";
categoryCell *cell = (categoryCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the data for the cell.
NSDictionary *dataItem = [data objectAtIndex:indexPath.row];
cell.icon = [UIImage imageNamed:[dataItem objectForKey:@"Icon"]];
cell.name = [dataItem objectForKey:@"Name"];
cell.num = [dataItem objectForKey:@"Num"];
return cell;
}
我怎样才能克服这个问题?
为cellForRowAtIndexPath方法添加一个断点。如果从未调用该方法,则其他数据源方法存在问题—表中的节数或节中的行数将返回0。