出现内存警告后如何保留导航历史记录?
在我的应用程序中,我有一个视图控制器,它抛出一个UIImagePickerController
,产生内存警告
。经过多次研究,我没有找到防止此警告的解决方案。
问题是:当我的应用程序收到内存警告
时,导航历史记录似乎丢失了,当用户按下后退按钮时,我的应用程序启动第一个控制器。 (就像当我的应用程序启动时)
在内存警告
之后我如何保留导航历史记录? 或者更好的是我如何使用UIImagePickerController
删除这个内存警告
? (我尝试了在 stackoverflow.com 和 google.com 中找到的很多解决方案)
对我来说另一个解决方案是防止内存警告释放控制器的所有数据。
In my app I have a viewcontroller which throwing an UIImagePickerController
that produces a memory warning
. After many research I don't have found a solution to prevent this warning.
The problem is: When my app receives a memory warning
the history of the navigation seems to be lost and when the user presses the back button, my app starts the first controller. (like when my app starts)
How i can keep the history of my navigation after a memory warning
?
Or better how i can remove this memory warning
with the UIImagePickerController
? (I tried a lot of solutions found in stackoverflow.com and google.com)
An other solution for me is to prevent the memory warning
to release all data of my controller.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不查看代码,我无法帮助您解决内存警告,但 TTNavigator 似乎会将您发送回堆栈中的第一个视图控制器,因为它无法保留其他视图控制器。
你继承自TTViewController吗?如果没有,你应该尝试一下。其次,如果从 TTViewController 继承后仍然遇到问题,请考虑在视图控制器中实现以下方法:
这些方法在 Three20UI 项目的 UIViewControllerAdditions.h 中定义。希望有帮助。
I can't help you with the memory warning without looking at the code but it seems like TTNavigator sends you back to the first view controller in the stack because it can't persist the others.
Are you inheriting from TTViewController? If not you should try that. Secondly if you're still having problems after inheriting from TTViewController look into implementing the following methods in your view controller:
Those methods are defined in UIViewControllerAdditions.h in the Three20UI project. Hope that helps.