Simulated low memory warning not working

走远了吗. 提交于 2019-11-30 20:56:51

问题


I have a UIWebView in a UIViewController. I am trying to push this view controller to an existing UINavigationController, that has another view controller which also has a UIWebView in it. After pushing the first view controller I try to simulate a memory warning, and then I hit "back" to go to the previous view controller, but now this webview is empty/blank. Any idea on how to go around this?

This is only happening on the iPad 1, running iOS 5.


回答1:


Under a low memory condition under iOS 5.x or earlier, a view controller's view may be unloaded. Then when it needs to be loaded again, the view controller's viewDidLoad will be called after the view is put back in place. Make sure you are doing the right things in viewDidLoad and viewDidUnload to handle this case.



来源:https://stackoverflow.com/questions/13106687/simulated-low-memory-warning-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!