Re: Confused by memory issue with UIDatePicker

I¹ve had a lot of experience with this and would like to share my basic
rules for IBOutlets when using ARC.  This should be fairly obvious, but I
think it needs saying.

1.  All top level objects in a nib should be strongly-referenced from the
file¹s owner, or from another such strongly-referenced top-level object.
(Could be more than one if you can ensure no reference cycles.) Otherwise,
said object will disappear immediately after nib loading.

2. All other outlets, including back to the file¹s owner, should be weak,
to prevent retain cycles.

Hopefully, this covers all cases.  (I¹m sure someone will let me know if it
doesn¹t.   :-)
_______________________________________________

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

Reply via email to