Search code examples
iosobjective-ccrash-reports

Strange stack trace in crash on thread


I am getting a very strange and very occasional, random crash on a secondary thread. I don't know what to make of the stack trace. Any ideas as to what could be happening here would be appreciated please?

enter image description here

This occurs when drawing strings and images to a graphic context on a background thread.


Solution

  • Finally got it - this was caused by calling some of NSString's drawing methods to a graphic context on a secondary thread. They are supposed to be thread safe but it is an iOS6 bug. Can be solved by using Core Text or NSAttributedString drawing methods.