• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextStorage subclass not updating NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSTextStorage subclass not updating NSTextView [SOLVED]
      • From: Roarke Lynch <email@hidden>
  • Prev by Date: Re: What can I do with an NSRange in Objective-C?
  • Next by Date: Need help moving an NSSlider
  • Previous by thread: HeaderDoc - fixes or alternatives
  • Next by thread: Re: NSTextStorage subclass not updating NSTextView [SOLVED]
  • Index(es):
    • Date
    • Thread