Re: Ugly bug in Foundation, beware!
Re: Ugly bug in Foundation, beware!
- Subject: Re: Ugly bug in Foundation, beware!
- From: Graham J Lee <email@hidden>
- Date: Thu, 03 Jun 2004 16:10:11 +0100
- Organization: University of Oxford Department of Redundancy Department
On 2004-06-03 16:01:43 +0100 Brent Gulanowski <email@hidden> wrote:
On Jun 3, 2004, at 10:36 AM, Graham J Lee wrote:
[example]
Forgive me if I'm being silly,
this may in fact be the case ;-)
but how would you deep copy that? NSHost
doesn't conform to NSCopying.
Collections are smart enough to ask a class if it conforms to
NSCopying
protocol.
Indeed. But if the class doesn't...then you don't get a deep copy,
surely? OK, in that specific instance then just copying the reference
rather than the object itself is probably suitable, but it was just a
mickey mouse example. A better example is one that Alastair just
posted, where a mutable object gets returned from a message that
returns a pointer to an immutable object; I also agree with his
numbered points regarding the raison d'etre of container classes and
the performance wipe associated with deep copying, FWIW.
Cheers,
Graham.
--
Graham Lee
Wadham College
OX1 3PN
_______________________________________________
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.