Object Copying Question
Object Copying Question
- Subject: Object Copying Question
- From: Greg Hulands <email@hidden>
- Date: Sat, 14 Sep 2002 23:49:34 +1000
Hi,
I have an object heirachy that all implements copyWithZone. In the
documentation it gives the following example for copying super:
- (id)copyWithZone:(NSZone *)zone
{
id cellCopy = [super copyWithZone:zone];
/* Assume that other initialization takes place here. */
cellCopy->titleCell = nil;
[cellCopy setTitleCell:[self titleCell]];
return cellCopy;
}
When doing the above, won't cellCopy only have enough memory for super,
and that the memory for self will not have been allocated?
Am i missing something here?
Any help is appreciated.
Regards,
Greg
_______________________________________________
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.