【发布时间】:2011-10-18 10:15:33
【问题描述】:
我的 TableViewCell 中有一个 UIImageView。当我不设置图像时,UI 的滚动和旋转工作非常顺利。但是当图像显示在单元格中时,滚动和旋转动画变得生涩。我使用延迟加载方法来显示单元格中的图像。为了显示图像,我正在维护一个 NSData 字典。如果存在与图像对应的数据,那么我只是在做
cell.Icon=[self imageForCellAtIndex:indexPath.row];
功能就像
-(UIImage*)imageForCellAtIndex:(int)index
{
Obj *ob=[mList objectAtIndex:index];
if([mIcons objectForKey:app.Icon100])
return [UIImage imageWithData:[mIcons objectForKey:ob.IconLink]];
else
{
[self DownloadIconForIndex:index];
}
return nil;
}
单元格的属性 Icon 设置为
@property(nonatomic,assign)UIImage *AppIcon;
在 cell.m 文件中,我覆盖了 setter
-(void)setIcon:(UIImage *)icon
{
iconImageView.image=icon;
}
我哪里出错了。请提出建议。
【问题讨论】:
标签: iphone uitableview uiimageview uiimage