relation between NSTextStorage and appended NSAttributedString
relation between NSTextStorage and appended NSAttributedString
- Subject: relation between NSTextStorage and appended NSAttributedString
- From: Arthur Clemens <email@hidden>
- Date: Sun, 6 Oct 2002 02:48:13 +0200
I am trying to do something but it is not so clear to me:
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.
So it seems that [NSMutableAttributedString appendAttributedString]
does not keep a pointer reference but makes a copy of the sent
attributedString, and then forgets about it.
The method description in the docs points says it actually:
appendAttributedString:
- (void)appendAttributedString:(NSAttributedString *)attributedString
Adds the characters and attributes of attributedString to the end of
the receiver.
In my program I *would* like to have a direct relation NSTextStorage
<----> pointer to NSMutableAttributedString object.
This is somewhat like the relation between a NSTableView and its data
source, I guess.
Would it be unnatural to follow this path?
Arthur Clemens
_______________________________________________
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.