Memory Management--"@property memory Management"1. parameters related to setter memory management in the@property
- retain : release old value ,retain new value (for OC object type);
- Assign : Direct Assignment , ( default , applies to non-OC object types);
- copy : release old value ,copy new value ;
2.whether the parameters of S- etter are generated inthe @property
- readonly : Only a getter declaration and implementation will be generated;
- ReadWrite : Both the declaration and implementation of setter and getter are generated;
3. Multithreading-related parameters in the @property
- nonatomic : high performance (usually with this);
- Atomic : low performance ( default );
4. Setting the use of setter and getter names in the @property
- setter : Set the name of the setter method, must have a colon ;
- Getter : Sets the name of the getter method (typically used in bool type, the method name of a getter of type bool, usually starting with is )
5. cyclic retain and @class
- @class : Just tell the compiler that a name is a class : for example,@class person; Just tell the compiler that the person is a class ( internal details are not known );
- Specification for referencing a class in development:
1. In. h fileUsed@class to declare the class(Cannot use #import, otherwise it will appearCircular References); 2. In. m fileUsed#importTo contain all the things of the class;
- Solutions for Circular references at both ends:
1. End Withretain parameters (@property ) ; 2. End WithAssign parameters (@property ) ;Note: Used theAssign, which is calledSet MethodWouldn't do it.retain, itDon'tInDeallocmethod to do this object in therelease.
Dark Horse programmer----Memory management of the third--"@property memory Management"