Re: Copying Oddity
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.