图片下载队列控制器
查看次数:4198
下载次数:862
上传时间:2014-04-29
大小:113 B
图片下载队列控制类,可以控制同时进行的图片下载数量。本代码利用AFNetWorking类库实现图片下载操作。
测试环境:Xcode 5.0,iOS 6.0以上
使用方法:
1、在TableView所在的ViewController中创建队列对象,并这是队列大小。
// 创建一个队列对象,以便在当前页面内统一控制下载数量。
// 页面不需响应图片下载完成的通知,将队列对象扔给具体需显示图片的TableViewCell,由Cell响应通知并显示图片。
_objImgListOper = [[RemoteImgListOperator alloc] init];
[_objImgListOper resetListSize:20];
2、在显示内容时,将队列对象扔给Cell,由Cell内部响应Notification。
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(remoteImgSucc:)
name:_objRemoteImgListOper.m_strSuccNotificationName
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(remoteImgFailed:)
name:_objRemoteImgListOper.m_strFailedNotificationName
object:nil];
收藏