Skip navigation.
 
mlRe: Copying NSTextStorage
FROM : Jens Alfke
DATE : Fri May 30 06:53:58 2008

On 29 May '08, at 11:03 AM, Gordon Apple wrote:

>    Apparently, NSTextStorage does not conform to NSCopying, even 
> though its
> superclass (NSAttributedString) does.  Has something changed 
> recently with
> NSTextStorage that makes "copy" not work?


Is there a reason you need to use NSTextStorage instead of 
NSAttributedString? Generally the only place NSTextStorage is used is 
in the innards of NSTextViews.

I'm not sure what -copy would do with an NSTextStorage, since it 
inherits from NSMutableAttributedString, and copying an 
NSMutableAttributedString returns an NSAttributedString. In other 
words, copying mutable objects returns immutable ones. Have you tried 
using -mutableCopy instead?

—Jens

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