Re: Questions about Nib Object Retention
Re: Questions about Nib Object Retention
- Subject: Re: Questions about Nib Object Retention
- From: Kyle Sluder <email@hidden>
- Date: Tue, 20 Oct 2009 23:04:03 -0700
I would tend to use a simpler pattern: make assign outlets on file's
owner for each top-level object, and release them in -dealloc.
This pattern is based on the tendency for nibs to be "part of" another
object. For example, think of NSWindowController or NSViewController.
Logically, the object graph living inside the associated nib is
really a necessary functional part of the controller object; it
doesn't make much sense to have a window controller with no window.
So the top level objects are almost always of interest only to other
objects in the nib (which don't factor into this whole scheme and
behave no differently than if they were created in code) and to file's
owner (which orchestrates the nib loading and therefore assumes
responsibility for curating its top level objects).
--Kyle Sluder
_______________________________________________
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