FROM : Alastair Houghton
DATE : Wed Jun 04 00:09:23 2008
On 3 Jun 2008, at 19:19, Ross Carter wrote:
> First I will echo what Jens has said: there's a strong probability
> that NSAttributedString or NSMutableAttributedString will do what
> need. NSTextStorage adds two capabilities to
> NSMutableAttributedString: it communicates with one or more
> NSLayoutManagers that are involved in laying out the attributed
> string in one or more NSTextContainers, and it supports some
> scripting commands.
I think it also uses a different internal representation (probably a
gap buffer) so that it can efficiently support editing. My guess is
that NSTextStorage is therefore a somewhat more expensive object to
throw around than an NS[Mutable]AttributedString, but that it will be
more efficient if e.g. you want to write a text editor.
> The notion of copying an NSTextStorage object does not make much
> sense to me.
Well I think it does make sense in that I don't see why you
*shouldn't* be able to copy one. That's not to say that I think it's
something that most applications would do on a regular basis though.
Kind regards,
Alastair.
--
http://alastairs-place.net
DATE : Wed Jun 04 00:09:23 2008
On 3 Jun 2008, at 19:19, Ross Carter wrote:
> First I will echo what Jens has said: there's a strong probability
> that NSAttributedString or NSMutableAttributedString will do what
> need. NSTextStorage adds two capabilities to
> NSMutableAttributedString: it communicates with one or more
> NSLayoutManagers that are involved in laying out the attributed
> string in one or more NSTextContainers, and it supports some
> scripting commands.
I think it also uses a different internal representation (probably a
gap buffer) so that it can efficiently support editing. My guess is
that NSTextStorage is therefore a somewhat more expensive object to
throw around than an NS[Mutable]AttributedString, but that it will be
more efficient if e.g. you want to write a text editor.
> The notion of copying an NSTextStorage object does not make much
> sense to me.
Well I think it does make sense in that I don't see why you
*shouldn't* be able to copy one. That's not to say that I think it's
something that most applications would do on a regular basis though.
Kind regards,
Alastair.
--
http://alastairs-place.net
| Related mails | Author | Date |
|---|---|---|
| Gordon Apple | May 29, 20:03 | |
| Jens Alfke | May 30, 06:53 | |
| Gordon Apple | May 30, 17:13 | |
| Kyle Sluder | May 30, 22:16 | |
| Gordon Apple | Jun 1, 01:49 | |
| Ross Carter | Jun 1, 17:59 | |
| Gordon Apple | Jun 3, 17:15 | |
| Kyle Sluder | Jun 3, 18:51 | |
| Ross Carter | Jun 3, 20:19 | |
| Kyle Sluder | Jun 3, 22:21 | |
| Alastair Houghton | Jun 4, 00:09 | |
| Sherm Pendley | Jun 4, 10:14 |






Cocoa mail archive

