Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying NSTextStorage




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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Copying NSTextStorage (From: Gordon Apple <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.