Is it possible to catch an exception thrown from one thread in another thread? For example, I am spawning a thread from my main thread. The spawned thread may throw uncaught exceptions. Is it possible to have the spawning thread catch these exceptions?
One solution would be to catch the exceptions from the entry point of the spawned thread and "handle" the exception by posting an NSNotification
. Then, the spawning thread can listen for these NSNotification
s. However, this solution seems a little corky because it's basically reimplementing the @catch clause given different types of NSException
s as a parameter. I wanted to check if any other solutions are available.
-fobjc-arc-exceptions
. So if you using exceptions right you're not "doing it wrong". For your Q see @Seva. – CRD