• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Distinguish Pending Text from Committed Text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Distinguish Pending Text from Committed Text (From: Dong Feng <email@hidden>)
 >Re: Distinguish Pending Text from Committed Text (From: Michael Ash <email@hidden>)
 >Re: Distinguish Pending Text from Committed Text (From: Dong Feng <email@hidden>)

  • Prev by Date: Re: Distinguish Pending Text from Committed Text
  • Next by Date: Only One Reason to ever use Transient Properties in Core Data
  • Previous by thread: Re: Distinguish Pending Text from Committed Text
  • Next by thread: [NSApp presentError:error] & Custom Icon ...
  • Index(es):
    • Date
    • Thread