objective-c singleton memory deallocation

2019-04-30 01:04发布

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

2条回答
放荡不羁爱自由
2楼-- · 2019-04-30 01:28

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.

查看更多
走好不送
3楼-- · 2019-04-30 01:32
登录 后发表回答