WOCrashProtector
一个无侵入的 iOS crash 防护框架,基于 Swizzle Method 的 Crash 防护。能有效的防止代码潜在的crash,自动在app运行时实时捕获导致app崩溃的破环因子,使app避免崩溃,照样可以继续正常运行。 主要参考了《大白健康系统--iOS APP运行时Crash自动修复系统》此文,以及AvoidCrash、QYCrashProtector、NeverCrash这三个框架编写而成。更多内容请看项目吧。
Install / Use
/learn @Wuou/WOCrashProtectorREADME
WOCrashProtector
Crash protection based on Swizzle Method. Can effectively prevent the code potential crash, automatically capture the broken loop factor that causes the app to crash when the app runs, so as to prevent the app from collapsing, so it can continue to function normally
前言
一个无侵入的 iOS crash 防护框架,基于 Swizzle Method 的 Crash 防护。能有效的防止代码潜在的crash,自动在app运行时实时捕获导致app崩溃的破环因子,使app避免崩溃,照样可以继续正常运行。 主要参考了《大白健康系统--iOS APP运行时Crash自动修复系统》此文,以及AvoidCrash、QYCrashProtector、NeverCrash这三个框架编写而成。更多内容请看项目吧。简书地址👈
功能
- unrecognized selector crash
- KVO、KVC crash
- NSNotification crash
- NSTimer crash
- Container crash(数组越界,插nil,字典objc、key为nil等)
- NSString crash(字符串截取越界等)
- NSAttributedString
使用方法
导入#import "WOCrashProtectorManager.h"
/**
启动所有组件
*/
+ (void)makeAllEffective;
/**
单独启动组件
@param protectorType 启动的组件类型
*/
+ (void)configCrashProtectorService:(WOCrashProtectorStyle)protectorType;

版本适配
系统支持 iOS 8.0 ~ iOS 11.2
注意事项
** 建议实际开发的时候关闭该组件,以便及时发现crash bug,需要上架或者演示的时候开启crash防护组件。 **
- 该组件中使用了@try@catch捕捉crash会占用极少量内存,不过正常情况下不影响性能。
- 目前尚未测试其他第三方框架共同使用时是否存在冲突的情况,如bugly、友盟等。
- 如果您发现了问题希望能issue,大家一起来解决问题 ^_^
- 最后,如果你觉得这个框架对你有帮助就给个star吧 ^_^
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
