Bindings, File Owner memory management in a NON document based app
Bindings, File Owner memory management in a NON document based app
- Subject: Bindings, File Owner memory management in a NON document based app
- From: Aurélien Hugelé <email@hidden>
- Date: Fri, 8 Jul 2005 17:48:21 +0200
Hi list !
I have a very simple nib, with a NSButton that i want to bind to my
File Owner's to enable or disable it.
Binding directly to my file owner's cause retain cycles, and thus my
file owner is never deallocated.
i'm aware of those documents : http://theobroma.treehouseideas.com/
document.page/18 and http://homepage.mac.com/mmalc/CocoaExamples/
controllers.html#memManagement, thanks to their authors. and i
understand them.
Those notes details the retain cycles that is happening with the
bindings, but they seems to explain that this problem *only* occurs
with NSDocumentControllers or NSWindowControllers ... or at least
only give a solution for these particular cases...
My nib doesn't have any window at all, just a simple view and a
button, bound to the File Owner's "canCancel" model key path.
I have tried the famous NSObjectController hack (setContent: in the
awakeFromNib), but of course it *does* retain the File Owner's, i
can't see how will this help the retain cycle problem but i tried it
anyway... The best techniques (for NSDocuments and
NSWindowControllers ) seems to unbind / setContent:nil in the
windowWillClose: method... but i repeat i have no windows!
How can i resolve this problem?
thanks for you help !
_______________________________________________
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