I have a system here that renders itself in bits that get stitched together. Sometimes those bits are rendered in an background threads, but sometimes when latency of feedback is really important those bits are rendered synchronously on the main thread.
This code is called on the main thread, in a method named
createPatchView
patchView.createRenderingOperation()
NSOperation
// Figure out when to render it
if async {
// Add the patch rendering job to the tile rendering queue.
tiledView.renderingQueue.addOperation(patchView.createRenderingOperation())
} else {
// Render and install the patch right now on the main thread for maximum responsiveness.
patchView.createRenderingOperation().start() // <-- CRASHES HERE
}
Signal: SIGSEGV: SEGV_ACCERR at 0x10
Reason: objc_msgSend() selector name: observationInfo
start()
main()
observationInfo
NSOperation
NSOperationQueue
patchView.createRenderingOperation().main()
start()
Refactor the code out of main
and put it somewhere else. Call that code from your operation's main
and whenever you want it to happen.