标签:des blog http io ar os for 文件 on
(1)效果

(2)源代码与资源下载
http://pan.baidu.com/s/1pJLo2PP
(3)总结
——核心是利用UITableView里面自带的cell来制作样式相同的cell。
与之相应的是,因为不是整个xib文件,所以加载这个cell时有一些区别,只需要在缓存池中取即可(利用ID)。
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *ID=@"app";
WPAppCell *cell=[tableView dequeueReusableCellWithIdentifier:ID];
return cell;
}-(void)setApp:(WPApps *)app{
_app=app;
self.icon.image=[UIImage imageNamed:app.icon];
self.name.text=app.name;
self.desc.text=[NSString stringWithFormat:@"%@ | %@",app.size,app.download];
if (!app.isDownloaded) {
self.download.enabled=YES;
}else{
self.download.enabled=NO;
}
}
- (IBAction)clickDownload {
self.download.enabled=NO;
self.app.downloaded=!self.app.isDownloaded;
}【iOS开发-68】APP下载案例:利用tableView自带的cell布局+缓存池cell复用时注意按钮状态的检查
标签:des blog http io ar os for 文件 on
原文地址:http://blog.csdn.net/weisubao/article/details/40978935