Binding not working in Document based app
Binding not working in Document based app
- Subject: Binding not working in Document based app
- From: Eric Gorr <email@hidden>
- Date: Sun, 5 Oct 2008 16:06:06 -0400
You can download a complete working and non-working project by grabbing:
http://ericgorr.net/bindings.zip
The first project called bindings was based on a simple Cocoa
Application. I setup all of the bindings and everything works as
expected.
The second project called bindingsdocs was based on a document-based
cocoa app. I setup up all of the bindings in the same way as the first
project, but they don't seem to be working after everything is
initialized.
For example, in the init function for MyDocument I have:
valueA = 10;
and when the application runs and the windows appears, the field
'Value A' contains the value of 10, as it should because I have bound
the field to MyDocument with the model key path 'valueA'.
I have also MyDocument observing valueA, which was setup by doing:
[self addObserver:self
forKeyPath:@"valueA"
options:NSKeyValueObservingOptionNew
context:NULL];
and the field 'Value A' was set to update it's value continuously.
When I type something into the field, my observeValueForKeyPath does
not get called.
As I mentioned above, all of the stuff works with a simple cocoa
application, but not a document-based cocoa application.
(p.s. selecting an item in the table causes valueC to change.)
Any clue as to why?
You can see the complete test projects by downloading the archive above.
Thank you.
oh, as a side note, I asked the following questions earlier, but
haven't received a response. The reason why I am asking is that I need
to programatically setup a resizable NSPanel and would like to know
what the dimensions of the resize indicator are - it would also help
to be able to know how to control it's size. I've seen it appear in a
couple of different sizes, but am unsure of how this would be
accomplished.
Can one programmatically control the size of the resize indicator on a
NSPanel? If so, how?
Is it possible to programmatically get or compute the frame the resize
indicator occupies on a NSPanel?
thank you.
_______________________________________________
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