2012-04-22 56 views
0

我正在实施这个。但图像并没有隐藏起来。什么是正确的方法?如何在单元格上删除UIImageView时删除

- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath; 
{ 
PlayerCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PlayerCell"]; 
cell.ratingImageView.hidden= YES; 
return; 
} 

回答

0

你需要获得在指数路径的实际电池,查看是否存在以下替换的伎俩:

PlayerCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 

干杯

+0

我想它和它的作品。但警告在那一行。 “不兼容的指针类型初始化'PlayerCell * __强'与'UITableViewCell *'类型的表达式' – zhtway 2012-04-22 07:19:34

+0

我认为你需要添加一个强制转换,因为该方法的返回类型是UITableViewCell你的PlayerCell是从那个类继承吗?也许你需要施放它(PlayerCell *)后面的= – 2012-04-22 07:25:43

+0

Playercell是一个prototypecell类。不知道如何投射,我将在网上浏览。谢谢 – zhtway 2012-04-22 07:29:17

1

你必须得到这是使用IndexPath选定单元格,然后隐藏单元格中的ImageView的。我很确定苹果教程有一个获取选定单元格的例子。