Skip navigation.
 
mlRe: Copying NSTextStorage
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

Related mailsAuthorDate
mlCopying NSTextStorage Gordon Apple May 29, 20:03
mlRe: Copying NSTextStorage Jens Alfke May 30, 06:53
mlRe: Copying NSTextStorage Gordon Apple May 30, 17:13
mlRe: Copying NSTextStorage Kyle Sluder May 30, 22:16
mlRe: Copying NSTextStorage Gordon Apple Jun 1, 01:49
mlRe: Copying NSTextStorage Ross Carter Jun 1, 17:59
mlRe: Copying NSTextStorage Gordon Apple Jun 3, 17:15
mlRe: Copying NSTextStorage Kyle Sluder Jun 3, 18:51
mlRe: Copying NSTextStorage Ross Carter Jun 3, 20:19
mlRe: Copying NSTextStorage Kyle Sluder Jun 3, 22:21
mlRe: Copying NSTextStorage Alastair Houghton Jun 4, 00:09
mlRe: Copying NSTextStorage Sherm Pendley Jun 4, 10:14