当在Xcode中添加UIViewController的新类时,模板不包含dealloc方法。
现在它不是一个大交易添加一个,显然,但我想知道是否有一个原因,它不包括在一个模板?
我认为苹果希望你使用:
- UI组件nib <
- 生成块/gh>
- 自动引用计数
上述所有技术都自动处理内存管理过程。但这只是一条建议路线。在Xcode 3.2中,我们将-dealloc
放在UIViewController
模板中。我经常用它。