What is the difference between (retain, nonatomic) and (nonatomic, retain) in code such as this:
@property (retain, nonatomic) YellowViewController *yellowViewController;
?
a : not relating to, concerned with, or composed of atoms Gerald Cleaver, professor and graduate program director in Baylorʼs department of physics, will present "Life on the Landscape," which will consider the place of the Earthʼs universe and the possibility of nonatomic-based (intelligent) life forms outside of it. ...
Nonatomic means multiple thread access the variable (dynamic type). Nonatomic is thread unsafe. But it is fast in performance. Nonatomic is NOT default behavior; we need to add nonatomic keyword in property attribute.
Retain increases the retain count of an object by 1 and takes ownership of an object. Whereas copy will copy the data present in the memory location and will assign it to the variable so in the case of copy you are first copying the data from a location assign it to the variable which increases the retain count.
Assign creates a reference from one object to another without increasing the source's retain count. Retain creates a reference from one object to another and increases the retain count of the source object.
There is no difference -- the order of property attribute specifiers is not important.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With