title: Custom Object Initialization in Objective-C
body: <p>I created a custom object in Objective-C. Now I want to create a custom initializer. The object has two properties, name and score. So my initializer is as follows:</p>
  
  <pre><code>- (id)initWithName:(NSString *)playerName {
  
      if ((self = [super init])) {
          self.name = [playerName retain];
          self.score = [NSNumber numberWithInt:0];
      }
  
      return self;
  }
  </code></pre>
  
  <p>Am I using <strong><code>retain</code></strong> here properly? Or can I just make it something like <code>self.name = playerName;</code>?</p>
  
  <p>Furthermore, assume I want another initializer, but keep the <code>initWithName:playerName</code> the designated initializer. How would I make the second initializer call the first?</p>
  
  <p>And for the last question, I know I need to override the <code>- (id)init</code> method too. However, what do I do there? Just assign test properties incase the class was initialized with <code>init</code> only?</p>
  
  <p>Thank you!</p>