title: Atomic vs NonAtomic when to use in Objective-C iOS
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/588866/objective-c-properties-atomic-vs-nonatomic">Objective-C properties: atomic vs nonatomic</a>  </p>
  </blockquote>
  
  
  
  <p>IN regards to he <strong>@property</strong> directives and setting the attribute <strong>nonatomic</strong> versus <strong>atomic</strong>:</p>
  
  <p>I do understand that you get a performance boost using the nonatomic attribute because the system does not lock the class variable to prevent from complications due to threading. Most examples and code I see in fact do use nonatomic most of the time. I think this is due to the fact that apps generally run on the main thread and don't use threads in their code.  But, I would suspect that a lot of the objects and their methods under the hood are thread based and may need to be locked down if i want to retain and access them. Is this true? and if so, how would i know to lock down that object by using the @property(assign, retain) .</p>
  
  <p>In other words, in what case would one find the case to use <strong>@property(assign, retain)</strong> when <strong>not</strong> writing threads in my app?</p>