解析自定义tableview单元格

时间:2015-03-19 12:39:19

标签: ios objective-c uitableview parse-platform tableviewcell

我正在尝试使用Parse框架为iPad应用程序创建自定义tableview单元格。当我在没有自定义单元格的情况下查询时,它工作正常,但只要我更改单元格标识符,我就会卡在加载图标上。

代码如下:

     - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object {
 static NSString *CellIdentifier = @"specielCelle";

 sagerCelle *cell = (sagerCelle *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
 if (cell == nil) {
 cell = [[sagerCelle alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
 }

 // Configure the cell
     cell.lblPolice.text = [object objectForKey:@"police"];
 //cell.textLabel.text = [object objectForKey:self.textKey];
 //cell.imageView.file = [object objectForKey:self.imageKey];

 return cell;
 }

1 个答案:

答案 0 :(得分:-1)

这是我的建议,(顺便提一下问题还不清楚)

首先使用indexpath.Row

更改您的标识符
    NSString *cellIdentifier=[NSString stringWithFormat:@"CELL_%d",(int)indexPath.row];

第二

如果您要更改现有单元格,那么您将无法进入

if(cell==nil)

因为你的细胞不是零。写下其他条件。

希望它有所帮助。

相关问题