0x00 崩溃
Xcode14.1
,打包出来,在系统iOS16
以上的手机崩溃,打开就闪退
崩溃日志:
Assertion failure in -[UITextField dealloc], UIView.m:4640
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application circumvented Objective-C runtime dealloc initiation for <UITextField> object.'
0x01 原因
iOS16
苹果不允许重写系统控件分类(Categroy
)中重写 + (void)initialize
方法
可以放在 + (void)load
方法中处理
或者
使用 dispathc_once
方法