我对iOS开发非常陌生,我面临着多线程问题。
我使用KTPhotobrowser和SDWebImage创建了一个照片和视频库。我必须在每一张图片上加载一些外部数据,我不想影响画廊滚动视图的平滑性。
所以,我试着用NSOperation和NSOperationQueue来做这件事,但我不确定我做得对。
我想要的是停止加载过程,如果用户不停留在图片上,继续滚动。
当前代码:
//setCurrentIndex is called when the scrollView is scrolled
- (void)setCurrentIndex:(NSInteger)newIndex {
[l