title: Using Realm trying to delete one object raises an exception ('Can only add an object to a Realm in a write transaction...')
body: <p>I'm trying to delete 1 object in realm but I can't perform this method. Is there something wrong? </p>
  
  <pre><code>var realm = RLMRealm.defaultRealm() 
  realm.beginWriteTransaction()
  var soo = Sample3()
  soo.sampleKey = "edit1"
  soo.id = 0
  realm.deleteObject(soo)
  realm.commitWriteTransaction()
  println("deleted")
  </code></pre>
  
  <p>It has this error...</p>
  
  <p><code>swiftRealm[50559:847671] *** Terminating app due to uncaught exception 'RLMException', reason: 'Can only add an object to a Realm in a write transaction - call beginWriteTransaction on an RLMRealm instance first.'</code></p>