Re: Overriding -copyWithZone: the right way
Re: Overriding -copyWithZone: the right way
- Subject: Re: Overriding -copyWithZone: the right way
- From: Bill Garrison <email@hidden>
- Date: Fri, 5 Nov 2004 16:42:59 -0500
On Nov 5, 2004, at 1:52 PM, Jean-Olivier Lanctôt wrote:
Is there an Apple document that tells us how to do it exactly?
I was just looking into this yesterday. Check out the NSCopying
protocol docs.
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Protocols/NSCopying.html>
DocoaBrowser also rocks for this:
<http://www.iwascoding.com/DocoaBrowser/>
On Fri, 5 Nov 2004 19:31:36 +0100, M. Uli Kusterer
<email@hidden> wrote:
At 17:46 Uhr +0100 05.11.2004, Michael Becker wrote:
- (id)copyWithZone:(NSZone *)zone {
PCShoppingCartCell *copy = [[ PCShoppingCartCell alloc]
initImageCell:nil];
return copy;
}
I implemented by copyWithZone: method using allocWithZone:, just to
preserve the use of the zone argument. I don't know if zones are used
much any more, so maybe it's doesn't matter and a plain alloc: would
suffice.
- Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden