• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Object Copying Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Object Copying Question
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: showing a checkbox and a pulldown-menu in a NSTableView
  • Next by Date: Re: Object Copying Question
  • Previous by thread: Re: showing a checkbox and a pulldown-menu in a NSTableView
  • Next by thread: Re: Object Copying Question
  • Index(es):
    • Date
    • Thread