title: How to copy a NSMutableArray in to another array?
body: <p>I am trying to copy an array to another array my code is below</p>
  
  <pre><code>NSMutableArray firstArray = [[NSMutableArray alloc]init];
  NSMutableArray secondArray = [[NSMutableArray alloc]init];
  [firstArray addObject:@"1"];
  [firstArray addObject:@"2"];
  [firstArray addObject:@"3"];
  [firstArray addObject:@"4"];
  [firstArray addObject:@"5"];
  
  // have tried following ways
  
  // 1
  secondArray=[firstArray copy];
  
  // 2
  [secondArray addObjectsFromArray:firstArray];
  
  //3
  secondArray = [[NSMutableArray alloc]initWithArray:firstArray];
  </code></pre>
  
  <p>It is working fine but the problem is that when modify the firstArray it reflects it changes in secondArray I don't want that.</p>
  
  <p>Please tell which is the correct way</p>