title: Objective C how to troubleshoot NSCoreDataOptimisticLockingException
body: <p>How can I troublehshoot _NSCoreDataOptimisticLockingException messages I am getting in the console? or debug it?</p>
  
  <p>I am using background thread to update the core data context and the I am merging the context on the main thread with the main thread object, but I am geting these console message and I am unable to see where they are coming from.</p>
  
  <pre><code>objc[58487]: EXCEPTIONS: catch(_NSCoreDataOptimisticLockingException)
  objc[58487]: EXCEPTIONS: unwinding through frame [ip=0x2235ec7 sp=0xb08e8a10] for exception 0x3dd42950
  objc[58487]: EXCEPTIONS: unwinding through frame [ip=0x22622a6 sp=0xb08e8ad0] for exception 0x3dd42950
  objc[58487]: EXCEPTIONS: handling exception 0x3dd42950 at 0x226234a
  objc[58487]: EXCEPTIONS: finishing handler
  </code></pre>
  
  <p>The first answer from @jonusx talked about using nested contexts to handle this situations, but what can be done to debug these exceptions when targeting the iOS 4 SDK?
  Thanks in advance.</p>