CrashProtect
处理常见的线上崩溃,通过 hook 相关方法捕获错误。
使用方法
pod CWCrashProtect
[CWCrashProtect openCrashProtect:ECWCrashProtectAll];
[CWCrashProtect setErrorHandlerBlock:^(CWCrashCatchError * error) {
// NSLog(@"%@", error);
//处理错误,如保存成文件上传服务器
NSAssert(NO, error.errorDesc);
}];