Doc-Based App Inspector vs Cocoa Binding
Doc-Based App Inspector vs Cocoa Binding
- Subject: Doc-Based App Inspector vs Cocoa Binding
- From: Don Carlile <email@hidden>
- Date: Sat, 25 Sep 2004 19:32:07 -0700
I know that both of these topics have been addressed recently on this list, but the overlap has not. It is in this space that I find myself, and I could use some help.
In the
Document-based Bindings and an Inspector window thread, mmalcolm crawford advised that the ay to use Cocoa bindings to create a document inspector is to create the inspector window in a different nib (I put mine in the MainMenu,nib) and bind he elements to the document through
<x-tad-bigger>[Shared Application].mainWindow.windowController.document.</x-tad-bigger> This (or rather a slight variation of this) is in fact what I had figured out for my application. And I must admit that it worked well, as far as getting the information from a document to the inspector, and vice versa.
The problem, and this brings us to the other topic, comes about when a window is closed. A document in my app provides new information to its window on a timed basis. When the window is closed, the document is not because retain count is too high. When the next interval comes for the document to update its window, the applicaiton crashes because there is no window. The too-high retain count is covered in the
Who should release whom in a document-based app? thread, among others. In that thread, Dennis DeMars and Allan Odgaard explain that this kind of behavior occurs as the result of retain cycles caused by the bound views retaining the document.
Allan Odgaard recommends manually unbinding the bindings, but I don't know how to find the bindings. Given that my bindings are done through the application's main window, and thus are changeable, I don't think adding IBOutlets is feasible.
Dennis DeMars says that he creates an NSObjectController in the nib, binds his view to that, and then programmatically sets the content of the controller to the model objects. Once again, I don't know how to find the object controller in order to do this.
I am probably missing something basic here. In fact, I hope I am. I am a relatively new Cocoa programmer.
Can anyone given me some help?
Thanks,
Don Carlile
_______________________________________________
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
References: | |
| >Cursor (From: Linea Tessile Srl <email@hidden>) |
| >Re: Cursor (From: Ricky Sharp <email@hidden>) |