且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将图像加载到iPhone系统缓存中?

更新时间:2023-10-10 19:08:58

使用图像(尤其是大图像)进行平滑滚动的表格视图并不是您想的那么简单.使用[UIImage imageNamed:]加载一堆图像会很快导致跳板杀死您的应用程序,因为它开始超过内存容量.看一下今年WWDC上的Core Animation 会议视频,特别是会议425,实践中的核心动画,第2部分"他们涵盖了这个确切的主题,并且做得很好.如果您使用开发者帐户登录,也可以获取相关的源代码.

Getting a table view with images (especially large ones) to scroll smoothly is not as trivial as you might think. Loading up a bunch of images with [UIImage imageNamed:] will very quickly cause springboard to kill your app as it starts to exceed memory capacity. Take a look at the Core Animation session videos from this year's WWDC, specifically look at session 425, "Core Animation in Practice, Part 2" They cover this exact topic and it's very well done. You can also get the relevant source code if you sign in with your developer account.