voidUncaughtExceptionHandler(NSException*exception) {
NSArray*arr = [exceptioncallStackSymbols];//得到当前调用栈信息
NSString*reason = [exceptionreason];//非常重要,就是崩溃的原因
NSString*name = [exceptionname];//异常类型
NSLog(@"%@", arr);
NSLog(@"exception type : %@ \n崩溃的原因: %@ \n call stack info : %@", name, reason, arr);
}
objc直接调用
NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
__________________________________________________________________________________
__________________________________________________________________________________