Re: Calling -stringValue on a spell checked text field clears the misspellings?
Re: Calling -stringValue on a spell checked text field clears the misspellings?
- Subject: Re: Calling -stringValue on a spell checked text field clears the misspellings?
- From: Douglas Davidson <email@hidden>
- Date: Mon, 12 Mar 2007 15:39:20 -0700
On Mar 12, 2007, at 3:25 PM, Nick Zitzmann wrote:
I have an NSTextField. The text field's editor has continuous spell
checking turned on. The text field's delegate calls -stringValue on
the field every time the field has changed, because it needs the
string value to accomplish another feature in the program.
But whenever it does this, the words that are visibly marked as
misspelled are updated so that the misspelling mark is cleared.
Once I remove the -stringValue message, this no longer happens, but
I need that string value when a change has occurred. What can I do
here?
If the control is currently editing, then you can call -currentEditor
on it to obtain the field editor (an NSTextView) that is handling the
editing. Probably the best thing for you to do is to obtain the
string that you are interested in directly from the field editor.
Bear in mind that this will be the raw value that is currently
displayed; for example, if there is a complex input method in use, it
may contain uncommitted partial inputs, or if there is a formatter
attached, then the formatter may not have gotten a chance to work on
it. The control's -stringValue is a processed value that is more
suitable for use after editing has finished.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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