title: Xcode Add NSMutableArray to a NSMutableArray
body: <p>I am adding an NSMutableArray to another NSMutableArray, the problem is all the objects in the first array are the same (length size content, etc).  I am guessing that when you add an array to an array the first array simple holds a pointer to a second, so how do I get it to hold a unique array?  I am thinking I need to use arrayWithArray when adding but I can not figure out syntax.</p>
  
  <p>My NSDictionary contains a number of Objects, each object has a load of image URLs which it then downloads.</p>
  
  <p>My code thus far;</p>
  
  <pre><code>for (NSDictionary *obj in MyDictList)
  {
      [tempImageArray removeAllObjects];
  
      for(NSString *tempImageURL in obj[@"images"])
      {
          tempImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:tempImageURL]]];
          NSLog(@"Download Extra Image : %@, %i", tempImageURL, [UIImagePNGRepresentation(tempImage) length]);
          [tempImageArray addObject:tempImage];
      }
  
      NSLog(@"Number of pics fo this event : %i", [tempImageArray count]);
  
      // Add the array of images to the array
      [eventImages addObject:tempImageArray];
  }
  </code></pre>
  
  <p>The logs through this out (as you can see each image URL and size if different).</p>
  
  <pre><code>Download Extra Image : http://.....A...Correct...URL/file.jpg, 69516
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 63263
  Number of pics fo this event : 2
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 69516
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 64545
  Number of pics fo this event : 2
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 56541
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 69144
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 51585
  Number of pics fo this event : 3
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 56813
  Download Extra Image : http://.....A...Correct...URL/file.jpg, 33869
  Number of pics fo this event : 2
  </code></pre>
  
  <p>When I then cycle through them I get 4 copies of the last array (i.e. just 2 pics).</p>
  
  <pre><code>Number of image in this Event at Row : 2, 0
  Number of image in this Event at Row : 2, 1
  Number of image in this Event at Row : 2, 2
  Number of image in this Event at Row : 2, 3
  </code></pre>
  
  <p>EDIT
  Thanks for help, nudge in right direction and changed last line to read;</p>
  
  <pre><code>[eventImages addObject:[NSArray arrayWithArray:tempImageArray]];
  </code></pre>