Newbie Confusion: Bindings & NSTextField
Newbie Confusion: Bindings & NSTextField
- Subject: Newbie Confusion: Bindings & NSTextField
- From: David Emme <email@hidden>
- Date: Mon, 26 Dec 2005 12:40:58 -0700
I have a preferences window with two NSTextFields and two corresponding
NSPopUpButtons. These set preferences for time periods: the text field
is used to enter a number, and the popup selects a unit. Example: "3"
and "Weeks".
I have these controls bound to a SharedDefaults object in my nib, and
the resulting updates to the textfields and popups are successfully
saved to my preferences file as one would expect -- usually.
Here's my problem: I bring up my preferences window and change "3 Weeks"
to "4 Days" by:
1. Select the "3" in the text field and type a "4" over it,
2. Change the "Weeks" to "Days" by making a different selection in the
popup
3. Close the preferences window (and even exit the application)
Result: the change to the popup is reflected in the preferences file,
but the change to the textfield is not. This is apparently because the
insertion point was left in the textfield, so it has never "finished
editing", even when the window is closed. If after I overtype the "3"
with the "4" I then tab or click to move to the other text field, then
the 3->4 change is recorded in my preferences file as expected.
This seems so counter-intuitive that I feel I must be missing something
basic. If my user opens the preferences window and simply changes the
value in the text field, s/he is going to expect the change to be
noticed.
What am I missing?
TIA,
-Dave
--
The 50-50-90 rule: Anytime you have a 50-50 chance of getting
something right, there's a 90% probability you'll get it wrong.
_______________________________________________
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