• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NIB's owner doesn't get released because of NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NIB's owner doesn't get released because of NSArrayController


  • Subject: Re: NIB's owner doesn't get released because of NSArrayController
  • From: "Jason Foreman" <email@hidden>
  • Date: Thu, 15 Jan 2009 08:44:07 -0600

On Wed, Jan 14, 2009 at 11:58 PM, Vitaly Ovchinnikov
<email@hidden> wrote:
> Well, OK. I am ready to release all root objects myself. Just tested
> with subclassed NSView from that NIB - it didn't get released
> automatically.
> So I added several -release calls to -dealloc method of my NIB's owner
> and now it will release everything.
> But the problem is still there: -dealloc of my view controller didn't
> get called because array controller still retains it!
> As I wrote above, I added special "killer" method that breaks binding
> and after calling it I can call -release and it will call NIB owner's
> -dealloc. But this is ugly...

It's not clear to me from this response, so just to double check:  do
you -release the array controller when you -release the view?  The
array controller is also a top-level object in your nib, so it needs
to be released.  This will have a similar effect to you calling
-unbind..., but is more correct.  What you are doing with -unbind is
likely leaking NSArrayController instances, so while your NSView will
have its -dealloc called, the array controller will not.


Jason
_______________________________________________

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

  • Follow-Ups:
    • Re: NIB's owner doesn't get released because of NSArrayController
      • From: "Vitaly Ovchinnikov" <email@hidden>
References: 
 >NIB's owner doesn't get released because of NSArrayController (From: "Vitaly Ovchinnikov" <email@hidden>)
 >Re: NIB's owner doesn't get released because of NSArrayController (From: "Jason Foreman" <email@hidden>)
 >Re: NIB's owner doesn't get released because of NSArrayController (From: "Vitaly Ovchinnikov" <email@hidden>)

  • Prev by Date: Re: NSPredicateEditor
  • Next by Date: Re: File association
  • Previous by thread: Re: NIB's owner doesn't get released because of NSArrayController
  • Next by thread: Re: NIB's owner doesn't get released because of NSArrayController
  • Index(es):
    • Date
    • Thread