Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(retain, nonatomic) and (nonatomic, retain) any difference?

What is the difference between (retain, nonatomic) and (nonatomic, retain) in code such as this:

@property (retain, nonatomic) YellowViewController *yellowViewController;

?

like image 932
Devoted Avatar asked Jun 26 '10 08:06

Devoted


People also ask

What does Nonatomic mean?

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. ...

What does Nonatomic mean OBJC?

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.

What's a difference between copy and retain?

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.

What is difference between assign and retain?

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.


1 Answers

There is no difference -- the order of property attribute specifiers is not important.

like image 96
walkytalky Avatar answered Sep 23 '22 05:09

walkytalky