Re: relation between NSTextStorage and appended NSAttributedString
Re: relation between NSTextStorage and appended NSAttributedString
- Subject: Re: relation between NSTextStorage and appended NSAttributedString
- From: Douglas Davidson <email@hidden>
- Date: Mon, 7 Oct 2002 10:15:21 -0700
On Saturday, October 5, 2002, at 05:48 PM, Arthur Clemens wrote:
In a NSTextView I have a NSMutableAttributedString object that I append
to the text view's NSTextStorage.
But if I change the NSMutableAttributedString object, this change is
not reflected in the NSTextStorage. And also the other way around: when
I type in the NSTextView, the NSMutableAttributedString object is not
updated.
The NSTextStorage _is_ a mutable attributed string. There's usually no
need to have a separate one.
If you wanted to have some more complicated means of storing the text,
you could create a custom subclass of NSTextStorage. If you wanted to
have a mutable attributed string that would track some subrange of your
text storage, you could create a custom subclass of
NSMutableAttributedString that would correspond to a range within the
text storage, and would pass everything through to the text storage.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.