场景:每个cell中有一个EGOImageView
问题的现象:在滚动时,无法加载图片;滚动一停止,很快就加载成功。
原理:
解决方法:来源
EGOImageLoader/EGOImageLoadConnection.m
line57
- _connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
+ _connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
+ [_connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
+ [_connection start];
EGOImageLoader/EGOImageLoader.m
line136
- [connection performSelector:@selector(start) withObject:nil afterDelay:0.01];
+ [connection performSelector:@selector(start) withObject:nil afterDelay:0.01 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];