UIScrollView性能问题
我在 uiscrollview 中将 2000 - 5000 张图像与名称捆绑在一起。当前的滚动视图在滚动过程中出现了很大的问题。
所以问题是如何提高性能。到目前为止我搜索的是我必须获得 NSOperations、NSQueue 之类的东西。但我无法获得任何相关的代码示例。我记得在 WWDC 2010 上观看过一些关于提升 UItableview 加载图像性能的视频。不幸的是我也不记得那个标题了(最糟糕的可能是 2009 年的视频会议)。
因此,请任何人指出我应该看到哪些教程或示例代码的正确方向。至少有苹果ios库参考链接吗?
I am bundling up 2000 - 5000 images in uiscrollview with names. The current scrollview has quite hiccups during scrolling.
So the question is about how to improve performance. What I have searched so far is that I would have to get on NSOperations, NSQueue like things. But I'm not able to get any code sample on that. I remembered watching some video on WWDC 2010 on boosting performance of UItableview loading images being exhibited. Unfortunately I'm not able to remember that title too (worst perhaps it was 2009 video session).
So please can anyone point to me in right direction about what tutorial or sample code should I see. Atleast apple ios library reference links?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UITableView 使用从池中延迟加载可重用单元格。
我建议您考虑实现类似的东西,以便只有实际查看的图像对象才能获取图像。
NSOperations 可能是您可以用来实现实际获取的东西,但也可以考虑使用 ASIHTTPRequest 来异步获取他们,因为这会为您处理所有排队和线程。
UITableView uses lazy loading of reusable cells from a pool.
I'd advise you look at implementing something like this, so that only images objects that are actually viewed fetch an image.
NSOperations may be something you could look at to implement the actual fetch with but also consider using ASIHTTPRequest to asynchronously grab them as this handles all the queuing and threading for you.