title: Objective-C Class init parameters
body: <p>I'm currently starting up with some Objective-C again. The problem I have is passing variables to the native init method of a class instance.</p>
  
  <p>I have this custom init in my @interface:</p>
  
  <pre><code>-(id)init
  {
      if(self = [super init]) {
          level = 1;
          NSLog(@"Debug response");
      }
  
      return ([NSObject init]); // return self;
  }
  </code></pre>
  
  <p>And here's my App's main class:</p>
  
  <pre><code>#import "AppDelegate.h"
  #import "PlayableCharacter.h"
  
  @implementation AppDelegate
  
  - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  {
      // Insert code here to initialize your application
      NSArray *params = [NSArray arrayWithObjects: @"Elf", nil];
  
      PlayableCharacter *allendar = [[PlayableCharacter alloc] init:params];
  }
  
  @end
  </code></pre>
  
  <p>Can someone explain what I'm doing wrong? I thought an NSArray object would fit the profile of an "id" C-object. Is giving init parameters illegal or must it be done in another way?</p>
  
  <p>The Error states: "No visible @interface for 'PlayableCharacter' declares the selector 'init:'"</p>