• 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 Oddity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying Oddity


  • Subject: Re: Copying Oddity
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 11 Jul 2003 09:28:52 -0700

On Friday, July 11, 2003, at 09:03 AM, The Amazing Llama wrote:

I just noticed that
-[NSTextStorage copy]
will provide you with an NSConcreteAttributedString, and not an NSTextStorage at all.

This makes a certain amount of sense, because NSTextStorage does not conform to NSCopying, where it's superclass NSAttributedString does, but it was still a little odd to see.

So I suppose since the superclass implements -copy, the subclass must, but to just pass the message on is a little odd.

Is this expected behavior? Or should it return nil or something?

Note that the special behavior of NSTextStorage consists primarily in its relationship to its layout managers, and a layout manager can have only one text storage, so that a copy of a text storage would in any event be unable to keep the same layout managers. You can file a bug about the current behavior if you find it undesirable, but in general I would say that other methods are more appropriate for duplicating and transferring the contents of documents.

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Copying Oddity
      • From: The Amazing Llama <email@hidden>
References: 
 >Copying Oddity (From: The Amazing Llama <email@hidden>)

  • Prev by Date: RE: Install two Mac OSX on one computer
  • Next by Date: [ANN] Cocoa source-code updated
  • Previous by thread: Copying Oddity
  • Next by thread: Re: Copying Oddity
  • Index(es):
    • Date
    • Thread