Re: Ownership of nib instances
Re: Ownership of nib instances
- Subject: Re: Ownership of nib instances
- From: Scott Herz <email@hidden>
- Date: Wed, 17 Oct 2001 16:33:54 -0700
Here are <echoing voice> THE RULES:
The File's Owner owns any top level items in the nib. Basically
everything in the document window except First Responder* is a Top Level
Object. It is the responsibility of the File's Owner to release top
level objects. There are some exceptions. For convenience**, windows
will commit suicide for you if you check the Release on Close box. Also,
as mentioned below, if the File's Owner is a window controller, it will
help you out by releasing any top level objects for you.
Scott.
*The First Responder isn't a real object. It's an abstract
representation of the responder chain and therefore cannot be
released...although you can try (it's nil).
**For whose convenience I don't know...certainly not mine, since I'm
left explaining it all of the time, but I'm happy to do it.
On Wednesday, October 17, 2001, at 04:13 PM, Joe Chan wrote:
JC> It seems to me that the file
JC> owner object some how has a hidden reference to all those
JC> instances, and as the file owner goes away, so do those objects.
If the File Owner happens to be an NSWindowController, it really has
some
kind of hidden reference to all those objects, and it truly releases
them
when it is unallocated.
Though, if you use a different class for File Owner, you have to do
that yourself.
Where is it documented that who owns (or not) which object in a nib? In
general, if I have a network of objects in a nib, what rules should I
use to establish ownership?
-----------
Joe Chan
email@hidden
http://www.firstian.com
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev