Re: Distinguish Pending Text from Committed Text
Re: Distinguish Pending Text from Committed Text
- Subject: Re: Distinguish Pending Text from Committed Text
- From: Gwynne Raskind <email@hidden>
- Date: Tue, 19 May 2009 22:47:17 -0400
On May 19, 2009, at 10:35 PM, Dong Feng wrote:
Thanks Michael and Gideon's reply. [NSTextInput markedRange] works.
A minor question is that [NSWindow fieldEditor] returns an NSText*,
rather than an NSTextView*. I think that's because of historical
reason and it should be safe to always cast a returned NSText point to
an NSTextView. Is it safe?
I don't know if it's safe 100% of the time, but if you do it, drop an
assert in your code for sanity's sake:
NSAssert( [returnedFieldEditor isKindOfClass:[NSTextView class]] ==
YES, @"Field editor is, in fact, an NSTextView." );
-- Gwynne, Daughter of the Code
"This whole world is an asylum for the incurable."
_______________________________________________
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