title: copyWithZone setting instance variables?
body: <p>Is the copyWithZone (See Below) correct, particularly the bit where I use the setters to populate the instance variables of the new object?</p>
  
  <pre><code>@interface Planet : NSObject &lt;NSCopying&gt;
  {
      NSString *name;
      NSString *type;
      NSNumber *mass;
      int index;
  }
  @property(copy) NSString *name;
  @property(copy) NSString *type;
  @property(retain) NSNumber *mass;
  @property(assign) int index;
  -(void)display;
  @end
  
  -(id) copyWithZone: (NSZone *) zone {
      Planet *newPlanet = [[Planet allocWithZone:zone] init];
      NSLog(@"_copy: %@", [newPlanet self]);
      [newPlanet setName:name];
      [newPlanet setType:type];
      [newPlanet setMass:mass];
      [newPlanet setIndex:index];
      return(newPlanet);
  }
  </code></pre>
  
  <h1>EDIT_001:</h1>
  
  <p>Is this a better way?</p>
  
  <pre><code>-(id) copyWithZone: (NSZone *) zone {
      Planet *newPlanet = [[[self class] allocWithZone:zone] init];
      [newPlanet setName:[self name]];
      [newPlanet setType:[self type]];
      [newPlanet setMass:[self mass]];
      [newPlanet setIndex:[self index]];
      return(newPlanet);
  }
  </code></pre>
  
  <p>many thanks</p>
  
  <p>gary</p>