title: How to deal with thread and Realm ? (iOS)
body: <p>I use Realm to store my model objects. In my object I have a function which generate <code>NSData</code> from its own properties values. This generation can be long, So I would like to generate my <code>NSData</code> in a <strong>thread with handler block</strong>.</p>
  
  <p>My problem is that Realm data access is only possible on the Realm creation entity (actually the main thread). So when I access to my <code>RealmObject</code> properties in a thread, application crash. According to Realm specs, it's normal. But what is the best solution to make my <code>NSData</code> generation in a thread depending to Realm limitation ? </p>
  
  <p>Actually I have two ideas :</p>
  
  <ul>
  <li>make a Realm specific dispatch queue and make all my Realm access write in this queue</li>
  <li>get all properties in need in a temp struct(or a set of variables) and work with this struct/variables to generate my <code>NSData</code> in a thread.</li>
  </ul>
  
  <p>I assume that a lot of Realm users need to deal with threads and Realm, so what did you do in this kind of case ?</p>