Simulated low memory warning not working

2019-02-16 05:37发布

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条回答
Lonely孤独者°
2楼-- · 2019-02-16 06:17

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.

查看更多
登录 后发表回答