title: Getting Null array
body: <p>I have following code :</p>
  
  <pre><code>- (IBAction)goButton:(id)sender 
  {
  
      if(buttonCount==0)
      {
          previousStateArray=setUpArray;
            NSLog(@"previous array count=%d",[previousStateArray count]);
          [setUpArray removeAllObjects];
          for(Node *n in nodeArray)
          {
              if(![temp isEqualToString:n.strName])
              {
                  [setUpArray addObject:n.strName];
  
              }
              temp=n.strName;         
          }    
      }
  }  
  
  - (IBAction)backButton:(id)sender 
  {
  
      [setUpArray removeAllObjects];
      setUpArray=previousStateArray;
       NSLog(@"previous array count=%d",[previousStateArray count]);
      buttonCount--;       
    }
  </code></pre>
  
  <p>Both setUpArray and previousStateArray are declared in the -<code>viewDidLoad</code> method.My view is loading only once.In first NSLog i am getting 1 as a output but in second NSLog i am getting </p>
  
  <p>0 as a output while none of my array initialize again . so why this is happening???</p>