title: Deep Copy and Shallow Copy
body: <p>I have read the answer for difference between deep copy and shallow copy from the post, <a href="https://stackoverflow.com/questions/184710/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy">What is the difference between a deep copy and a shallow copy?</a> . Now I got some doubt that when we made a shallow copy by</p>
  
  <pre><code> newArray = [NSmutableArray arrayWithArray:oldArray];
  </code></pre>
  
  <p>the new array will point to oldArray. (As from the figure).  Now what happen when I remove object from newArray? As from figure, it should remove same element from oldArray too !!! It seems like </p>
  
  <p><code>newArray = oldArray</code> is a shallow copy and <code>newArray = [NSmutableArray arrayWithArray:oldArray];</code> is deep copy. Is it right?</p>