Re: Commit Editing Changes as I Type
Re: Commit Editing Changes as I Type
- Subject: Re: Commit Editing Changes as I Type
- From: Wyatt Webb <email@hidden>
- Date: Wed, 6 Jan 2010 16:12:44 -0800
There's an option on the binding labeled "Continuously Updates Value" in IB. Make sure that's on. (or set it in the options dictionary if you're using the API call to bind).
On a separate note, instead of a timer to check for changes, try setting a delegate on that NSTextField and watching for the controlTextDidChange: notification. You'll get those when the contents of the field change in any way (so you'll get one after each letter typed, for example), so you'll know precisely when a change is made. But, if you fix the binding, you shouldn't need this at all.
Wyatt
On Jan 5, 2010, at 2:50 PM, cocoa-dev wrote:
> I have two controls (NSTextField and a NSTableView column) that are bound to the same attribute in core data. I've set up a timer that starts after the NSTextField starts editing and I'd like it to periodically commit the editing as the user is typing. If the user hits the Enter key I do see the text in both places but I want those updates to go as the user is typing so the text will show in both fields as the typing is happening.
>
> When my timer launches I tried calling:
>
> [myTextField commitEditing] // but this didn't work, nothing happened.
>
> I then tried:
>
> [[myTextField window] endEditingFor:nil] // which worked but the NSTextField loses focus so that's not a good solution.
>
> Any ideas?
_______________________________________________
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