Re: Nib top-level object ownership?
Re: Nib top-level object ownership?
- Subject: Re: Nib top-level object ownership?
- From: Ricky Sharp <email@hidden>
- Date: Fri, 30 Dec 2005 22:32:28 -0600
On Dec 30, 2005, at 10:14 PM, Jim Correia wrote:
Back before NSNib, if you instantiated a nib and were not an
NSWindowController subclass, you were responsible for making sure
that all the top level objects were sent a release message.
Now that we have NSNib, if I use
-instantiateNibWithOwner:topLevelObjects:
to instantiate a nib, am I responsible for sending a release
message to each object in the returned topLevelObjects array when I
am done with the nib? It would appear so, since I have leaks
without i, but the documentation doesn't explicitly state one way
or the other, at least in the places I've looked :-)
Yes, you're responsible for releasing those objects.
I started a couple threads[1] about this within the past few weeks.
I was revamping my app due to leaks and I started out by trying
instantiateNibWithOwner:topLevelObjects:. I couldn't really get that
to work due to circular dependencies, so I ended up subclassing
NSWindowController. The e-mails I wrote point out other gotchas.
[1] Search on the subjects "instantiateNibWithOwner:topLevelObjects:
usage" and "Releasing all nib objects"
___________________________________________________________
Ricky A. Sharp
mailto:email@hidden
Instant Interactive(tm)
http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden