• 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: NSTableView text editing notifications/delegation vs. attributed string cells?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView text editing notifications/delegation vs. attributed string cells?


  • Subject: Re: NSTableView text editing notifications/delegation vs. attributed string cells?
  • From: Nick Zitzmann <email@hidden>
  • Date: Tue, 28 Feb 2006 10:37:26 -0700


On Feb 28, 2006, at 10:25 AM, Jim Correia wrote:

Suppose I have a cell for which -allowsEditingTextAttributes is true. What is the preferred way to get back the attributedString in textShouldEndEditing?

If the NSText object is really an NSTextView or subclass, then you can get the object's text storage object, and that gives you the attributed string (NSTextStorage is a subclass of NSMutableAttributedString). This ought to work 99% of the time.


If the NSText object isn't, which IIRC only happens if you created a custom field editor that subclasses NSText instead of NSTextView, then you can call -RTFDFromRange: with the full range of the text and use the result to make an attributed string.

Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSTableView text editing notifications/delegation vs. attributed string cells? (From: Jim Correia <email@hidden>)

  • Prev by Date: NSTableView text editing notifications/delegation vs. attributed string cells?
  • Next by Date: Re: NSTableView text editing notifications/delegation vs. attributed string cells?
  • Previous by thread: NSTableView text editing notifications/delegation vs. attributed string cells?
  • Next by thread: Re: NSTableView text editing notifications/delegation vs. attributed string cells?
  • Index(es):
    • Date
    • Thread