FROM : Bill Garrison
DATE : Fri Nov 05 22:42:59 2004
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
> <witness.of.<email_removed>> 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
DATE : Fri Nov 05 22:42:59 2004
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
> <witness.of.<email_removed>> 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






Cocoa mail archive

