Tricky binding and continuous update problem
Tricky binding and continuous update problem
- Subject: Tricky binding and continuous update problem
- From: Chris Idou <email@hidden>
- Date: Tue, 6 Apr 2010 16:36:59 -0700 (PDT)
I've got a problem that I had working, but my app suddenly seems broken, and I'm not sure if I did something or what. All I know is old versions of my app work, but now my code base doesn't.
I've got a UI with a NSTableView at the top, and some individual fields at the bottom. Typical UI where you click on a table row and it shows you the values in the fields.
Now one of the fields shown in the table is a derived value from the base fields. I have continuous update values set in the NSTextField at the bottom. So what I expect as you type in the field, the value in the table gets continuously updated also. (I'm using keyPathsForValuesAffectingXXXX etc for the derived field).
But what's happening is if I type in the lower field, the value gets sent to the derived field in the table, but then Text field gets immediately set back to the original value. So the effect is you type one character and it is lost as far as the lower field is concerned, but the derived value in the table is updated. You can only ever change one character. And also the lower text field loses focus.
I've put break points in all the setters and getters, and there seems like no reason for this odd behavior. I can't see how the field would get set back to the old value.
If I turn off Continuously Update Value, it works sensibly, albeit not as nice since you've got to exit the field to have everything in synch.
Any thoughts?
_______________________________________________
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