Posted in code with : ios, objective-c
All the attributes of a property defines how the compiler generate the getter
and setter
accessors.
atomic / nonatomic
strong / weak: used for ARC.
assign / retain / copy: go to here for reference. These properties define how the compiler generate the setter
accessor.
readonly / readwrite: if a property is declared as readonly
, the compiler will only declare the getter accessor, so that you can not call setter accessor. This is called readonly
.
Apart from above, @synthesize
define the instance variable used for accessors. @synthesize
can only be used to property, not iVar. For more info, see Property vs Instance Variable (iVar) in objective-c.
Here has a detail description. And the useful part: