title: Unable to access NSMutableArray Objects even after declaring properly
body: <p>I am stuck with a very weird problem, atleast for me, unable to figure out what's the solution .The Problem is I have got two nsMutableArrays declared in interface </p>
  
  <pre><code> NSMutableArray *lastItemForFormula;  
   NSMutableArray *lastItemForExpression;  
  
   @property (nonatomic, retain) NSMutableArray *lastItemForFormula;
   @property (nonatomic, retain) NSMutableArray *lastItemForExpression;  
  </code></pre>
  
  <p>and then synthesized them in the implementation:  </p>
  
  <pre><code>@synthesize lastItemForFormula;
  @synthesize lastItemForExpression;  
  </code></pre>
  
  <p>Trying to use it my my function like this:  </p>
  
  <pre><code>-(void)elementClicked:(id)sender {
      UIButton *btnClicked=(UIButton*)sender;  
      NSString* formula=[label text];  
      NSString *stringToBeConcatenated=[elements objectAtIndex:btnClicked.tag];  
      formula=[formula stringByAppendingString:stringToBeConcatenated];  
      [lastItemForFormula addObject:[formula copy]]; //First 
      [label setText:formula];  
      stringToBeConcatenated=[elements objectAtIndex:btnClicked.tag+1];  
      if ([labelExpression.text length]==0) {  
          [lastItemForExpression addObject:[stringToBeConcatenated copy]];  //Second
          [labelExpression setText:[lastItemForFormula objectAtIndex:[lastItemForFormula count]]];  
      }  
      else {  
          [lastItemForExpression addObject:[[NSString stringWithFormat:@"%@+%@",[labelExpression text], stringToBeConcatenated] copy]]; //Third 
          [labelExpression setText:[lastItemForFormula objectAtIndex:[lastItemForFormula count]]];  
      }  
  }  
  </code></pre>
  
  <p>But when I am debugging the program, i get nothing in both arrays... Constantly show 0x0 when hovering over both. I am sure that most likely it's memory management issue. I'll be much obliged for any help.</p>