NSTextStorage subclass not updating NSTextView
NSTextStorage subclass not updating NSTextView
- Subject: NSTextStorage subclass not updating NSTextView
- From: Roarke Lynch <email@hidden>
- Date: Sun, 8 Feb 2004 19:00:49 -0500
Hello,
I have needed to subclass NSTextStorage, I read the docs that apple
provides. Problem is that all the calls are being made, the storage in
my class (an NSMutableAttributedString) retains the right value and is
mutated properly, but the associated text view never gets up dated.
Here's the code:
- (NSString *)string {
return [_backingString string];
}
- (NSDictionary *)attributesAtIndex:(unsigned)index
effectiveRange:(NSRangePointer)aRange {
return [_backingString attributesAtIndex:index
effectiveRange:aRange];
}
- (void)replaceCharactersInRange:(NSRange)aRange withString:(NSString
*)aString {
[_backingString replaceCharactersInRange:aRange withString:aString];
}
- (void)setAttributes:(NSDictionary *)attributes range:(NSRange)aRange {
[_backingString setAttributes:attributes range:aRange];
}
According to the apple docs, AFAIK, this is all i need to do to
implement a working subclass of NSTextStorage. There is nothing else in
the class at this point, the NSTextStorage is replaced, not set, with
respect to the NSTextView. What am I missing?
Roarke Lynch
-------------------------------
email@hidden
_______________________________________________
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.