Kyle Sluder <k...@ksluder.com> wrote: > On Sun, Jun 16, 2013, at 05:00 PM, Daniel Wambold wrote: >> Quincey Morris wrote: >>> >>>> I have a UIDatePicker in an .xib file with its File's Owner set to a >>>> custom class, MyTimeDatePickerVC. The MyTimeDatePickerVC inherits from >>>> UIViewController, and has an IBOutlet attached to the UIDatePicker. >>> >>> What does the IBOutlet declaration for the UIDatePicker look like? >> >> @interface MyTimeDatePickerVC : UIViewController <UITableViewDelegate, >> UITableViewDataSource> >> { >> IBOutlet UIDatePicker *myTimeDatePickerUI; >> >> The connection is shown in the margin as the circle with a central dot, >> as expected, and on inspection, it shows it's connected to the >> MyDateTimePickerVC~iphone's Picker. > > From "Managing Nib Objects in iOS", in the Legacy Patterns section of > the Nib Files chapter of the Resource Programming Guide > <http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW19>: > > """As it rebuilds the object hierarchy, UIKit reestablishes connections > between the objects using setValue:forKey:, which uses the available > setter method or retains the object by default if no setter method is > available. This means that (assuming you follow the pattern shown above) > any object for which you have an outlet remains valid.""" > > For this reason, that document recommends you use a weak declared > property for outlets to non-top-level objects. You should probably > follow that recommendation. > > --Kyle Sluder
Indeed, I should. Thank you for pointing me to this document, Kyle. Best regards, -Dan _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com