title: Initializer element is not a compile-time constant
body: <p>I understand that few users have already asked about the error listed in Title line. However, I am a novice in Objective-C programing and I am not able to connect how the responses on other pages answer why I am getting an error for this program.</p>
  
  <p>Thanks!</p>
  
  <pre><code>@interface ClassA:NSObject
  
  {
      int x;
  }
  
  -(void)initVar:(int) a;
  
  @end
  
  @implementation ClassA
  
  -(void)initVar:(int) a
  {
      x=a;
  }
  
  @end
  
  @interface ClassB:ClassA
  
  -(void)printVar;
  
  @end
  
  @implementation ClassB
  
  
  -(void)printVar
  {
      NSLog(@"X = %i", x);
  }
  
  ClassA *a= [[ClassA alloc] init]; // shows error: Initializer element is not a compile-
                                    // time constant.
  [a initVar:100]; 
  
  @end
  </code></pre>