Mac OS X Reference Library Apple Developer
Search

Creating a Subclass of NSTextStorage

NSTextStorage isn’t a fully concrete class; rather, it is the abstract superclass of a class cluster, as described in “Class Clusters”. It defines the storage for its NSLayoutManager objects and implements some methods, but doesn’t provide the primitive attributed string methods to subclasses. A subclass must define the storage for its attributed string, typically as an instance variable of type NSMutableAttributedString, override init and define its own initialization methods (or define constructors in Java), and implement the primitive methods of both NSAttributedString and NSMutableAttributedString. The Objective-C primitive methods are:

The Java methods are:

Beyond these requirements, if a subclass overrides or adds any methods that change its characters or attributes directly, those methods must invoke edited:range:changeInLength: (in Java, editedInRange) after performing the change in order to keep the change-tracking information up to date. See the description of this method for more information.




Last updated: 2005-08-11

Did this document help you? Yes It's good, but... Not helpful...