Re: text field question
Re: text field question
- Subject: Re: text field question
- From: Michael Babin <email@hidden>
- Date: Thu, 23 Feb 2012 13:04:02 -0600
On Feb 23, 2012, at 7:24 AM, Michael Babin wrote:
> On Feb 22, 2012, at 6:59 PM, Rick C. wrote:
>
>> I have a panel with a number of text fields where a user should enter numeric values. These text fields are setup with Sent on End Editing so that if the user presses enter or tabs or changes text fields the value will be entered. The problem is sometimes a user just types in a value and that's it...no enter, no tab, no changing text fields and the value is never received. How does everyone else handle this and what can you recommend? Thanks,
>
> If you're using bindings, set the Continuously Updates Value flag of the Value binding on your text field.
>
> If you're not using bindings, implement the controlTextDidChange: method in the text field's delegate (if your text field doesn't have a delegate, set its delegate to the appropriate controller object).
As pointed out by a sharper reader than I, these methods would change the behavior of these fields to always updating on each change.
If you're looking for a method that would preserve the behavior of changes only sent when exiting the field (tab, enter) or when the window is closed (or similar event),
I'd recommend the approach in the TextEdit sample's Preferences class:
https://developer.apple.com/library/mac/#samplecode/TextEdit/Listings/Preferences_m.html
Particularly, the -[Preferences windowShouldClose:] method, where you set the window's firstResponder to nil.
_______________________________________________
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