Strong, weak, retain, assign, copy, nonmatic, retainnonmatic
Assign: simple assignment, without changing the index count (Reference Counting) to the basic data class
Copy: Create an object with an index count of 1 and release the old object. For NSString
Retain: Release the old object, assign the value of the old object to the input object, and increase the index count of the input object to 1.
Difference between weak and strong:
The difference between weak and strong is that when an object no longer has a pointer of the strong type pointing to it, it will be released, even if there is a weak pointer pointing to it. Once the last strong pointer leaves, the object will be released and all remaining weak pointers will be cleared.
Differences between copy and retain:
Copy actually creates the same object, but retain is not;
Copy is content copy, and retain is Pointer copy;
Copy is a copy of the content. For NSString, if NSArray is copied, only the pointer pointing to the corresponding element in the array is copied. This is called "Shallow copy ".
Differences between _ block and _ weak Modifiers
_ Block can be used in both ARC and MRC modes. It can modify objects and basic data types.
_ Weak can only be used in ARC mode, and can only modify the object (NSString). It cannot modify the basic data type (int ).
The _ block object can be assigned a value again in the block, __weak is not allowed.