[SOLVED] Re: Calling -stringValue on a spell checked text field clears the misspellings?
[SOLVED] Re: Calling -stringValue on a spell checked text field clears the misspellings?
- Subject: [SOLVED] Re: Calling -stringValue on a spell checked text field clears the misspellings?
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 12 Mar 2007 16:51:44 -0600
On Mar 12, 2007, at 4:39 PM, Douglas Davidson wrote:
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.
Thanks Douglas. For the record, changing this:
NSString *changedText = [aTextField stringValue];
to this:
NSString *changedText = [[[[(NSTextView *)[aTextField currentEditor]
textStorage] string] copy] autorelease];
fixed the problem and doesn't seem to break anything (famous last
words).
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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