• 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
Re: Copying NSTextStorage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying NSTextStorage


  • Subject: Re: Copying NSTextStorage
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 29 May 2008 21:53:58 -0700


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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Copying NSTextStorage
      • From: Gordon Apple <email@hidden>
References: 
 >Copying NSTextStorage (From: Gordon Apple <email@hidden>)

  • Prev by Date: Re: CGContextSetRGBFillColor() off by one?
  • Next by Date: Re: Another newbie question
  • Previous by thread: Copying NSTextStorage
  • Next by thread: Re: Copying NSTextStorage
  • Index(es):
    • Date
    • Thread