Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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




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: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSTableView text editing notifications/delegation vs. attributed string cells? (From: Jim Correia <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.