by jcizzle · 10y ago · 0 comments
NSSetUncaughtExceptionHandler({exception in
print("\(exception)")
exit(1)
});Even if you could modify the behavior, having the default work this way would still be terrible.
edit: Also I'm not suggesting to just naively exit(1). edit2: Strangely, exception generating code in [[NSOperationQueue mainQueue] addOperationWithBlock:] does actually hit the NSUncaughtExceptionHandler, which was surprising to me.
Good call about reportException:. Although I personally prefer to just avoid NSAssert. The good old C assert() gets the job done well for me.