开发者

iOS Multitasking: Reductions performed by system upon entering background

开发者 https://www.devze.com 2023-01-30 19:21 出处:网络
I\'ve watched the WWDC 2010 talks about adopting multitasking and I have started enabling our app, however I have a question regarding releasing non-visible views.

I've watched the WWDC 2010 talks about adopting multitasking and I have started enabling our app, however I have a question regarding releasing non-visible views.

According to the talk (Session 105 - Adopting Multitasking on iPhone OS, Part 1 - 00:34:50) it is stated that the system releases "non-visible UIViewController views" when entering the background. However during my testing (in the simulator), I'm not seeing this happen.

The -viewDidUnload methods aren't being called, and after entering the foreground and viewing a previously hidden VC, the -loadView method is not being called either. So the hidden VC views in my UITabBarController aren't being released at all, contrary to what they said in the talk. Any ideas?

There's no mention of this in the "Moving to the Background"开发者_开发技巧 documentation, only in the talk.

Any clarification would be greatly appreciated.


Have you tried simulating a memory warning while your app is in the background? I believe that the views are only released when other apps start requesting memory. If memory consumption stays the same, your views are not released so that you can switch back quicker.

0

精彩评论

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

关注公众号