我在下面有这个设置,但是当我触摸表格单元格时,我得到了警告,所以我知道该方法正在被调用,但单元格左侧的图像没有更改。这是我的代码如下所示: 在视图控制器我有这2种方法:更改触摸表格单元格的UIImage
cellImage在.H声明,我在此.M合成它,以及
正下方上面的方法,我有这样的一个(我改变图像的底部!
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
NSString *cellselected = [NSString stringWithFormat:@"cell selected %@", [tabledata objectAtIndex:indexPath.row]];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert" message:cellselected delegate:self cancelButtonTitle:@"close" otherButtonTitles:nil];
[alert show];
//------------------------------------------------------------------------------start
cellImage = [UIImage imageNamed:@"checkboxfull.png"];
//----------------------------------------------------------------------------end
}
需要的所有帮助我能得到,感谢
你试图引用直接的UIImageView的形象? “cell.imageView.image = [UIImage imageNamed:@”checkboxfull.png“];” 我不知道,但也许“cell.imageView.image = cellImage;”需要UIImage的副本,因为它仍然没有加载到内存中。 – Markus 2012-02-20 17:01:20