ObjectController preventing window from closing
ObjectController preventing window from closing
- Subject: ObjectController preventing window from closing
- From: Jonathan Taylor <email@hidden>
- Date: Mon, 07 Nov 2011 16:08:13 +0000
Hi all,
This is probably a very basic question, but I am out of ideas and hoping someone can offer some help. I should say that I'm afraid I'm somewhat out of my depth with ObjectControllers: I added some seemingly simple bindings at the recommendation of a poster on here, and I thought I understood what it was doing, but the fact that I am now having retain issues suggests otherwise!
I have a window and window controller which in the absence of an object controller work fine, and both are deallocated when the window is closed. If I add an ObjectController to the NIB and bind its "Content Object" to "File's Owner.self" then the window no longer closes properly. The window disappears from the screen but the controller is not released as it should be. I get a windowWillClose notification, but the one [self autorelease] that I do from there is not enough to release the window. The controller appears to be still retained by the ObjectController. In the actual NIB there are various GUI elements bound to the object controller, but I have removed all those bindings, just leaving the single binding from the OC to "File's Owner.self" and I still have this problem of non-deallocation. If I remove that final binding, so the object controller is completely isolated, the window controller releases as one would expect (though I suspect the object controller may be leaked).
Is there something important that I should be doing here? Should I somehow be releasing the object controller, or indicating to it that it is no longer required? I realise that the information I've given here may be incomplete, because I don't even know what factors may be important in understanding the problem! Any advice would be very welcome though, as I am completely out of ideas...
Regards,
Jonathan._______________________________________________
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