Problem with bindings and cleaning up a view
Problem with bindings and cleaning up a view
- Subject: Problem with bindings and cleaning up a view
- From: Steve Israelson <email@hidden>
- Date: Thu, 28 Jun 2007 08:53:07 -0700
I have a nib file and controller that has an NSArrayController and an
NSObjectController and a table view and a custom grid view I have made.
A different controller for my window will instantiate one or more of
these controllers to add its set of views into its window.
This works like spotlight.
My nib + controller class manages one spotlight category, like
"documents" or "images" and the controller for the window creates as
many of these "category" sections as are needed for the search.
This works great until it comes time to dispose of one of these
"category" sections.
I can't just release the controller since that will do nothing since
the window etc all have retained objects from the NIB and the array
controller retains me too. So, instead I have written a "detach"
method that goes through and removes my view from its superview and
releases all the top level items from the nib.
The problem I am getting is when the autorelease pool does its thing
I get a crash in a bindings related call:
"NSKeyValueObservationInfoCreateByRemoving"
So, is there some trick to tearing down your view + controller such
that it actually gets dealloc'd and does not later crash?
_______________________________________________
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