[英]Parse custom tableview cell
我正在尝试使用Parse框架为iPad应用程序创建自定义表格视图单元。 当我在没有自定义单元格的情况下进行查询时,它可以正常工作,但是一旦我更改了单元格标识符,我就会停留在加载图标上。
代码如下:
- (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;
}
这是我的建议(顺便提一下,问题尚不清楚)
首先使用indexpath.Row更改您的标识符
NSString *cellIdentifier=[NSString stringWithFormat:@"CELL_%d",(int)indexPath.row];
第二
如果您要更改现有的单元格,那么您将无法进入
if(cell==nil)
因为你的细胞不是零 写其他条件。
希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.