首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Objective-C 内存储器管理之dealloc方法中变量释放处理

2012-10-08 
Objective-C 内存管理之dealloc方法中变量释放处理If you want your application to crash when a release

Objective-C 内存管理之dealloc方法中变量释放处理

If you want your application to crash when a released pointer is accessed during development and debugging, the solution is to use the traditional approach in your debug configuration. If you want your application to degrade gracefully for your users, the solution is to use the newer approach in your release and ad hoc configurations.?
在你开发和调试期间,当一个指针被访问时如果你想要你的程序直接crash,解决方案就是用最传统的方法在你的调试环境。如果你想你的程序友好的呈现给用户,解决方法是用新的方法,在你的release并且加上额外配置。
One somewhat pedantic implementation of this approach would be this:?
一种比较死板的实现这个理论的方法会像是这样:


在这种情境下有没有好处,貌似没有...似乎它都不能成为你做决定使用那种方法的一个参考因素。也就是说,我没有有力的证据,在这个问题上欢迎大家来讨论互相启发。

热点排行