视图会消失不点火 [英] view will disappear is not firing

查看:144
本文介绍了视图会消失不点火的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用addSubView方法添加的看法。做任何替代方法有用于viewWillDisappear? viewWillDisappear不点火。我要释放所有分配的对象在当前视图得到dissapear。目前我使用dealloc方法来做到这一点。但dealloc方法快速射击不行。因为我得到的内存warings,有时我的应用程序可能会崩溃本身。主要的问题是与语音文件。

i am using addSubView method to add views. Did any alternative methods are there for viewWillDisappear? viewWillDisappear is not firing. I want to release all allocated objects when the current view get dissapear. Currently i am using dealloc method to do this. But dealloc method is firing not quickly. Since i am getting memory warings and sometimes the my app may crash itself. The main problem is with voice files.

推荐答案

addSubview / removeFromSuperview(这些方法涉及与意见不视图控制器)犯规调用viewWillAppear中/ viewWillDisappear方法。你应该写释放对象code中的dealloc()本身。结果
removeFromSuperview应该调用的dealloc()。

addSubview/removeFromSuperview (these methods relate with views not view controllers) doesnt call viewWillAppear/viewWillDisappear methods. You should write release object code in dealloc() itself.
removeFromSuperview should call dealloc().

这篇关于视图会消失不点火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆