开发者

Memory management for multiple Views in iOS

I'm developing an application for iOS where I need to load many views. My application needs to switch in and out the views as the user wishes. These views take up a lot of memory and I n开发者_JAVA百科eed to manage this somehow.

I was wondering if anyone could give me direction as to how to tackle this? Should I use persistant storage and write some of my views to disk? Any other suggestions?

Thanks!


What you should do is release them when you aren't using them anymore, and create them again when you need them (saving state if you need to restore the view in some condition). For example.


For sure you will want to unload your unused views. In addition, make sure you have your views set up for when you get a memory warning the app can handle it gracefully.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜