问题描述
我使用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().
这篇关于视图会消失不点火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!