Delayed UIImageView Rendering in UITableView

后端 未结 4 1220
清歌不尽
清歌不尽 2020-12-12 12:56

Ok, I\'ve got a UITableView with custom UITableViewCells that each contain a UIImageView whose images are being downloaded asynchronou

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 14:01

    You should read up on NSRunLoop. I suspect that, during scrolling, the run loop is running in NSEventTrackingRunLoopMode, and the NSURLConnection isn't included in that mode. You could probably get around this by calling NSURLConnection's scheduleInRunLoop:forMode:, so that download can happen during scrolling.

    This will probably affect scrolling performance, which is probably the reason for the separate run loop mode in the first place. But try it out and see how it feels!

提交回复
热议问题