title: Objective-C: Copy Array, Modify Element (Object) in the Copy ONLY
body: <p>I've read through many SO posts before asking this question and I'm guessing this answer was in there somewhere, but I didn't see it.  I'm new to Objective-C and I'm trying to do a (seemingly) simple action that I can't figure out.</p>
  
  <p>The general idea is that I have an <code>NSArray</code> filled with objects (specifically of type <code>UIImageView</code>).  I want to copy that array, which I've done a number of ways (all successful).</p>
  
  <p>After a copy it, I now have two arrays.  I want to modify an object, say at index 2, <strong>ONLY</strong> in the copy.</p>
  
  <p>So far it seems like, because the copy is merely copying the <em>reference</em> (or pointer), changing the object at index 2 will change it in both the copy <em>and</em> the original.</p>
  
  <p>Does that make sense?</p>
  
  <pre><code>NSArray *originalArray = @[object1, object2];
  </code></pre>
  
  <p>Ways I've tried copying this array, so that I can achieve what I want:</p>
  
  <pre><code>NSMutableArray *originalArrayCopy = [NSMutableArray arrayWithArray:originalArray];
  
  NSArray *originalArrayCopy = [originalArray copy];
  
  NSMutableArray *originalArrayCopy = [[NSMutableArray alloc] initWithArray:originalArray];
  </code></pre>
  
  <p>And it seems that in each case, modifying an object from the copy also modifies it in the original.</p>
  
  <p><strong>NOTE:</strong> While <code>NSArray</code> is obviously immutable, the objects within my original array <em>are</em> mutable.</p>