I see this example in the beginning of iOS development ,the chapter of picker view.
And i don’t understand why it use a strong reference here.
@property (strong, nonatomic) IBOutlet UIDatePicker *datePicker;
We always use weak property to reference the UI components.
Their superview will hold an array of subview.(hold the array of subviews, also hold each subview, Am I right?).
Therefore, I think we can just use a weak reference to reference the picker which is an subview of the main view. And the main view will hold the picker.
Apple recommends that outlets should be declared as weak references.
I seem to recall that the advice used to be the opposite. If so, it seems likely that your example was written when the recommendation was to use
strong(orretain, if it originally predated ARC).(And I don’t think this is a duplicate, since this question is specifically in reference to outlets and not about the fundamental difference between
strongandweak.)