• 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
relation between NSTextStorage and appended NSAttributedString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: relation between NSTextStorage and appended NSAttributedString
      • From: Douglas Davidson <email@hidden>
    • Re: relation between NSTextStorage and appended NSAttributedString
      • From: Dietrich Epp <email@hidden>
References: 
 >Re: How to draw a 1-pixel non Antialiased line (From: Paul Fox <email@hidden>)

  • Prev by Date: Re: applicationShouldTerminateAfterLastWindowClosed
  • Next by Date: Re: How to draw a 1-pixel non Antialiased line
  • Previous by thread: Re: How to draw a 1-pixel non Antialiased line
  • Next by thread: Re: relation between NSTextStorage and appended NSAttributedString
  • Index(es):
    • Date
    • Thread