The difference between copy and retain:
Copy is to create a new object, retain is to create a pointer to reference the object Count plus 1. The Copy property represents the same contents as two objects, the new object retain to 1, independent of the reference count of the old object, and the old object does not change. Copy reduces the object's dependency on the context
The Retain property indicates that two objects have the same address (creating a pointer, copy of the pointer) and, of course, the same content, the retain value of this object +1 thatis, retain is a pointer copy, copy is a copy of the content.
of course not all objects in iOS support copy, mutablecopy, classes that obey the Nscopying protocol can send copy messages, and classes that follow the Nsmutablecopying protocol can send mutablecopy messages. If a copy or mutablecopy is sent without complying with the appeal agreement, an exception will occur. However, the default iOS class does not follow these two protocols. If you want to customize copy then you must obey Nscopying and implement Copywithzone: method, if you want to customize mutablecopy then you must obey Nsmutablecopying, and implement Mutablecopywithzone: Method.
iOS provides copy and Mutablecopy methods, as the name implies, copy is copying a Imutable object, and Mutablecopy is copying a mutable object.
Deep copy and shallow copy of iOS development (mutablecopy and copy)