Should I somehow release shared object (on which singleton is based) when my application terminates if no garbage collector used (iPhone environment)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
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.
回答2:
As an aside, you might find this useful:
http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html