I have read a lot of topics about the atomic
and nonatomic
attributes in Objective-C, and I understand that atomic
means thread safe and therefore nonatomic
is faster. But the main problem is that I don't understand what are threads at all and how they are being expressed in the code. Are they kind of methods? And I also noticed that most of the properties are nonatomic
, why is that? I saw that threads may access setter or getter of a property simultaneously, how is this possible and how is this being expressed in the runtime? Also as a newbie programmer should I prefer atomic
or nonatomic
?
I have searched in a lot of questions regarding this but none has actually answered my question.