Copy: Create an object with an index count of 1, then release the old object retain: Release the old object, and assign the value of the old object to the input object, then increase the index count of the input object to 1. What does the above mean? Copy actually creates the same object, but retain is not: for example, if an NSArray object has an address of 11111 and the content is xxCopy to another NSArray object, the address is 22222 and the content is the same, the new object retain is 1, and the old object does not change retain to another NSArray, the address is the same (create a pointer, copy pointer), and the content is of course the same, the retain value of this object is + 1, that is, retain is a pointer copy, and copy is a content copy. Under what conditions is assign used, retain used, and copy used? Assign: assign, instead of retain or copy, should be used for non-having relations. Retain or copy: when the class has mutable subclass, you should use copy instead of retain. For example: NSCharacterSet, NSDictionary, NSData, NSCharacterSet, NSIndexSet, and NSString.