Re: loadNibNamed:owner: Who disposes of the loaded objects?
Re: loadNibNamed:owner: Who disposes of the loaded objects?
- Subject: Re: loadNibNamed:owner: Who disposes of the loaded objects?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Thu, 25 Sep 2003 14:10:53 +0200
At 16:52 Uhr -0700 24.09.2003, Matthew Formica wrote:
<http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources
/Concepts/NibFileLoaded.html>
"Releasing Nib File Objects
When you load a nib file, all its top level objects have a reference count
of one. When the objects are no longer needed, another object needs to
release them. That other object is usually the file's owner.
I don't think there's a link to this page anywhere on the page that
documents loadNibNamed:owner:, is there? I option-clicked
loadNibNamed: and then looked around starting there, but didn't find
anything. It'd be helpful if there was a link at the top with all the
other "Techniques and Concepts" entries on that page pointing to this.
Do I have to file a bug on this, or could you forward that info to
the documentation team?
Note that NSWindowController automatically releases its nib file's objects
for you. Also, NSWindow has a isReleasedOnClose attribute, which
automatically releases the window for you when it's closed."
If I want to provide the same behavior as NSWindowController in my
app, how do I determine what objects are in my NIB file? Currently,
all objects are in an NSView resp. an NSPanel, but later there may be
other objects in there, and I'd like to avoid leaking anything.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.