title: Correct way to multithread in objective-c?
body: <p>I have a UITableView which displays images. Every cell has an image and every time a cell loads, I call a selector (from the cellForRowAtIndexPath) in the background like this:</p>
  
  <pre><code>[self performSelectorInBackground:@selector(lazyLoad:) withObject:aArrayOfData];
  </code></pre>
  
  <p>The only problem is that sometimes I get a crash (because I am changing data in the background while it's trying to be read elsewhere). Here's the error:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection &lt;CALayerArray: 0xce1a920&gt; was mutated while being enumerated.'
  </code></pre>
  
  <p>When updating the data in the background, should I move it to the main selector and change it? Or should I call the @selector() differently?</p>
  
  <p>Thanks!</p>