本文介绍了objective-c单例内存释放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的应用程序没有使用垃圾收集器(iPhone环境),我应该以某种方式释放共享对象(基于单身人身份)吗?

Should I somehow release shared object (on which singleton is based) when my application terminates if no garbage collector used (iPhone environment)?

推荐答案

当应用程序退出时,将释放其所有内存。因此,只要你在运行时不使用太多内存就完全释放对象并不重要。

When an application exits, all its memory is released. So it really does not matter if you release objects at all, so long as you don't use too much memory while running.

即使策略在4.0中发生变化,一个小物体不会产生太大影响;当它终止时,它仍将与应用程序的其余部分一起发布。

Even when the strategy changes in 4.0, a single small object won't have much impact; it will still be released along with the rest of the application when it terminates.

这篇关于objective-c单例内存释放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 18:37