【发布时间】:2012-08-30 19:32:01
【问题描述】:
我正在开发一个启用了 ARC 选项的 iPhone 应用程序。我在 .h 文件中创建 IBOutlets,这些文件从文件所有者图标连接到 .xib 元素。例如。
IBOutlet UIButton *bt;
@property(nonatomic,retain)IBOutlet UIButton *bt;
在.m文件中,我正在做
@synthesize bt;
是否需要在 viewDidUnload 方法中将 bt 显式设置为零?即self.bt = nil; in viewDidUnload?
另外,我是否需要在启用 ARC 选项的情况下编写 dealloc 方法?何时应在启用 ARC 的情况下将 IBOutlets 元素设置为强引用和弱引用?
【问题讨论】:
标签: ios xcode automatic-ref-counting weak-references strong-references