further confusion regarding the release of controls loaded from a nib
further confusion regarding the release of controls loaded from a nib
- Subject: further confusion regarding the release of controls loaded from a nib
- From: G S <email@hidden>
- Date: Tue, 20 Mar 2012 13:49:23 -0700
The Apple doc for iOS says:
"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 should 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."
This just adds more confusion. If the properties for the majority of
IBOutlets are weak (since they're usually all going to be owned by the
UIViewController's view), why would we release them in dealloc? That seems
like an error. And setting them all to nil in viewDidUnload wouldn't seem
to have any effect, other than simply being good practice for safety.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden