模拟的低内存警告不起作用

编程入门 行业动态 更新时间:2024-10-26 14:27:59
本文介绍了模拟的低内存警告不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在 UIViewController 中有一个 UIWebView 。我试图将此视图控制器推送到现有的 UINavigationController ,它有另一个视图控制器,其中还有一个 UIWebView 它。在推送第一个视图控制器之后,我尝试模拟内存警告,然后我点击返回转到上一个视图控制器,但现在这个webview为空/空白。关于如何解决这个问题的任何想法?

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?

这只发生在运行iOS 5的iPad 1上。

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

推荐答案

在iOS 5.x或更早版本的低内存条件下,可以卸载视图控制器的视图。然后当需要再次加载时,视图控制器的 viewDidLoad 将在视图重新放回后调用。确保你在 viewDidLoad 和 viewDidUnload 中做正确的事情来处理这种情况。

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.

更多推荐

模拟的低内存警告不起作用

本文发布于:2023-11-24 11:13:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624973.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   内存

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!