Re: Manual binding questions.
Re: Manual binding questions.
- Subject: Re: Manual binding questions.
- From: Jiva DeVoe <email@hidden>
- Date: Sun, 23 Jan 2005 19:09:49 -0700
Ok, so slider not posting KVO change notifications explains that. I
have read through the linked doc a bunch of times (that's the only doc
on bindings I can find really) But I don't see a list there of what
DOES post change notifications and what doesn't. How does one know?
And what's the recommended way to handle a control like that then?
So it seems like there's something more fundamental I am not getting.
Ie: In another case, I have an array of arrays managed through an
NSArrayController. So, I have a view that I want to bind the currently
selected array to so that I can do something with that array. However,
my NSArrayController only seems to post change notifications when I
click outside the tableview handling the current selection and not when
I click around in the tableview on different elements of the array..
Why is this?
Example of what I mean:
MyDocument.h:
IBOutlet NSArrayController mailboxesController;
MailboxView *mailBox;
MyDocument.m:
-(void)awakeFromNib;
{
[mailBox bind:@"mailArray" toObject:mailboxesController
withKeyPath:@"selection.mail" options:nil];
}
In IB, I have a NSTableView view bound to my mailboxesController which
shows my array of mailboxes. As I click the different mailboxes, my
"mailArray" setter in MailboxView does *not* get called. But if I
click outside the nstableview, it does.
What is it I am not understanding?
On Jan 23, 2005, at 4:31 PM, mmalcolm crawford wrote:
On Jan 23, 2005, at 1:11 PM, Jiva DeVoe wrote:
[_myView bind:@"sliderVal" toObject:_slider
withKeyPath:@"doubleValue" options:nil];
I get the initial value this is set to when it starts up, but when I
subsequently slide the slider up and down, it does NOT update my
view.
What am I doing wrong?
Binding two views to each other. You should bind _myView's value to
the model property.
(For the technical issue: the slider does not post KVO change
notifications. See:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaBindings/Concepts/HowDoBindingsWork.html>
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
--
Jiva DeVoe
jiva at devoesquared.com
http://www.devoesquared.com
_______________________________________________
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