我正在使用ARC专门为iOS 5开发.应该IBOutlets UIView(和子类)是strong或weak?
下列:
@property (nonatomic, weak) IBOutlet UIButton *button;
将摆脱所有这一切:
- (void)viewDidUnload
{
    // ...
    self.button = nil;
    // ...
}
这样做有什么问题吗?模板正在使用strong,当从"Interface Builder"编辑器直接连接到标题时创建的自动生成属性,但为什么?在UIViewController已经有一个strong到其基准view保留其子视图.
cocoa-touch objective-c interface-builder ios automatic-ref-counting
我注意到比在OSX中,NSTextView不能用于弱反射(如果你尝试将它连接起来很弱,你会得到)
Cannot form weak reference to instance (0x600000122da0) of class NSTextView. It is possible that this object was over-released, or is in the process of deallocation.
默认情况下,XCode的出口也会创建为assign
为什么不能有弱参考?可能是什么原因?