Initialize a NSString member variable inside the view controller
<p>I have a NSString member variable declared in the header file of the view controller:</p>

<pre><code>
@interface MyApprViewController : UIViewController {
 NSString *var;
        ... 
}

@property (retain) NSString *var;
...

-(IBAction)buttonPressed: (id)sender;
</code></pre> 

<p>Inside the implementation, I use <code>@synthesize var</code> and try to use that var from within the implementation of the buttonPressed method, but it does not work properly and I assume it is because var was never initialized. Where can I initialize this variable? I do not want to do it inside the method; I want to do it once of course, because I will keep appending text to it:</p>

<pre><code>
-(IBAction)buttonPressed: (id)sender {
 NSString *input = ((UIButton *)sender).currentTitle;
 var = [var stringByAppendingString:input];
 textField.text = var;  
 }

 [input release];
}
</code></pre> 

<p>I tried overriding the init method inside the view controller class, but it never gets called (maybe because there is no explicit initialization of the view controller class?) So, where should I initialize <code>var</code> so that I can use it inside the view controller class (inside the buttonPressed method)?</p>

<p>Thanks,
Mihai</p>
