Re: NSUserDefaultsController and NSTextField
Re: NSUserDefaultsController and NSTextField
- Subject: Re: NSUserDefaultsController and NSTextField
- From: Byron Wright <email@hidden>
- Date: Wed, 6 Jul 2005 16:28:11 -0700
thanks guys using method 2 worked a charm. I knew Apple had done all
the work already :)
On Jul 6, 2005, at 2:59 PM, Ron Lue-Sang wrote:
value then hit the "Ok" key the last textfield values they updated
I assume you mean "hit the Ok button", not key... yes?
Two options that come to mind are:
1) turning on the continuously updates values checkbox for the
value binding on the text field... Then the value will be applied
roughly as tho changes were tracked via controlTextDidChange:...
This could be expensive tho...
2) your "ok" button should call commitEditing (callback based or
otherwise) on the controller to which your UI is bound. This will
force any editors registered with the controller to "end editing"
if possible, returning YES if the values were committed
successfully and NO otherwise ... take a look at the documentation
for NSEditorRegistration and NSEditor
Option 2 is what I'd go for.
-----------------------------
Ronzilla
Core Bindings/Cocoa Data
Date: Wed, 6 Jul 2005 11:49:20 -0700
From: Byron Wright <email@hidden>
Subject: NSUserDefaultsController and NSTextField
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
This isn't really related to the defaults controller as such, however
I would like changes to a NSTextfield to be "registered" when the
value in the field changes and not when losing focus or hitting the
enter key. I have a preferences window and am using
NSUserDefaultsController and bindings to synch my prefs. However, the
it seems that unless the enter key or the NSTexfield loses focus the
defaults are not getting written (bindings are only getting applied
during textDidChange: notifications?) So basically if they enter a
value then hit the "Ok" key the last textfield values they updated
won't get written to the defaults... really annoying. Am I missing
something simple in IB or a method in the NSTextField class hiearchy?
I don't see an easy way to do this without creating a custom
NSTextField class and providing this functionality myself?
Cheers,
Byron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bluebearstudio.com
This email sent to email@hidden
_______________________________________________
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