From a practical perspective, in iOS and OS X outlets should be defined as declared properties. Outlets should generally be weak, except for those from File’s Owner to top-level objects in a nib file (or, in iOS, a storyboard scene) which should be strong. Outlets that you create will therefore typically be weak by default, because:
-
Outlets that you create to, for example, subviews of a view controller’s view or a window controller’s window, are arbitrary references between objects that do not imply ownership.
-
The strong outlets are frequently specified by framework classes (for example, UIViewController’s view outlet, or NSWindowController’s window outlet).
@property (weak) IBOutlet MyView *viewContainerSubview; @property (strong) IBOutlet MyOtherClass *topLevelObject;
英文不是太好,大致理解意思是说,在 ARC 中,一般outlet属性都推荐使用 weak, 而 File's Owner连接到 nib 的顶层对象应该使用 strong。通俗一点说就是,如果是你自定义的view,不是做为主视图的子视图直接显示,而是你自己实例化创建出来并加入主视图里的,那么你需要自己保留对象所有权,需要使用strong。
关于这一点,参考了念茜blog里的文章:http://blog.csdn.net/yiyaaixuexi/article/details/7864974
总结:
之所以有上面困惑,是对对象所有权问题的没理解透彻,找到问题的根源,才能拔云见日。