Re: NSTableView text editing notifications/delegation vs. attributed string cells?
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