首页 > 解决方案 > 'NSInternalInconsistencyException',原因:'无法在 iOS 11 之前的设备上解码特殊类型'14'

问题描述

我的一个屏幕崩溃了,它是使用 xib 文件启动的。崩溃日志很忙,实际上并没有指出可能是罪魁祸首。在 iOS 11 和 12 上一切正常。我搜索了网络,因为 NSInternalInconsistencyException 很常见,但没有找到与我相同的原因。

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'cannot decode special type '14''
*** First throw call stack:
(
0   CoreFoundation                      0x04faa494 __exceptionPreprocess + 180
1   libobjc.A.dylib                     0x04772e02 objc_exception_throw + 50
2   CoreFoundation                      0x04faa3bd +[NSException raise:format:] + 141
3   Foundation                          0x01f62945 newDecodedValue + 497
4   Foundation                          0x01f65ce4 -[NSPlaceholderValue initWithCoder:] + 32
5   UIKit                               0x0379949d UINibDecoderDecodeObjectForValue + 739
6   UIKit                               0x037991b2 -[UINibDecoder decodeObjectForKey:] + 320
7   UIKit                               0x034bb719 -[_UIAttributeTraitStorageRecord initWithCoder:] + 157
8   UIKit                               0x0379949d UINibDecoderDecodeObjectForValue + 739
9   UIKit                               0x037996ae UINibDecoderDecodeObjectForValue + 1268
10  UIKit                               0x037991b2 -[UINibDecoder decodeObjectForKey:] + 320
11  UIKit                               0x034ba383 -[_UITraitStorage initWithCoder:] + 227
12  UIKit                               0x0379949d UINibDecoderDecodeObjectForValue + 739
13  UIKit                               0x037996ae UINibDecoderDecodeObjectForValue + 1268
14  UIKit                               0x037991b2 -[UINibDecoder decodeObjectForKey:] + 320
15  UIKit                               0x034b9fdd -[_UITraitStorageList initWithCoder:] + 174
16  UIKit                               0x0379949d UINibDecoderDecodeObjectForValue + 739
17  UIKit                               0x037996ae UINibDecoderDecodeObjectForValue + 1268
18  UIKit                               0x037991b2 -[UINibDecoder decodeObjectForKey:] + 320
19  UIKit                               0x03585f21 -[UINib instantiateWithOwner:options:] + 1627
20  UIKit                               0x03312380 -[UIViewController _loadViewFromNibNamed:bundle:] + 429

标签: iosswiftuikit

解决方案


事实证明,iOS 11 之前的设备不支持使用语言方向边距。将其替换为 Xib 中的标准边距,错误原因为:“无法解码特殊类型 '14'”应该得到解决。


推荐阅读