On the mac, I found that NSSetUncaughtExceptionHandler can not catch the exception without a dispatch block, but if the crash code in a dispatch block, the crash handler can do. As the below code, the exception produced by method 'crash' can not been caught, but exception produced by method 'dispatchCrash' can been caught.
Code Block - (void)didClickBtn { // [self crash]; [self dispatchCrash]; } - (void)dispatchCrash { dispatch_async(dispatch_get_main_queue(), ^{ NSArray *testArray = [NSArray arrayWithObjects:@"test",@"test1", nil]; NSLog(@"%@", testArray[10]); }); } - (void)crash { NSArray *testArray = [NSArray arrayWithObjects:@"test",@"test1", nil]; NSLog(@"%@", testArray[10]); }