今天一个新接手的项目出现了这样的错误:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<xxx: 0xxxx> returned nil from -traitCollection, which is not allowed.'
全局断点也不能找到正确的位置
原因是尖括号里的类没有初始化,竟然只写了alloc没有init
本文探讨了一个新接手的项目中出现的Objective-C内存管理错误,详细解析了'NSInternalInconsistencyException'异常的原因,并提供了排查此类问题的思路。
今天一个新接手的项目出现了这样的错误:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<xxx: 0xxxx> returned nil from -traitCollection, which is not allowed.'
全局断点也不能找到正确的位置
原因是尖括号里的类没有初始化,竟然只写了alloc没有init
1万+
1万+
1万+
1万+
1670
773

被折叠的 条评论
为什么被折叠?