我的其中一个屏幕出现崩溃,这是使用 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
最佳答案
事实证明,在 iOS 11 之前的设备上不支持使用语言方向边距。将其替换为 Xib 中的标准边距,并解决错误原因:“无法解码特殊类型‘14’”。
关于ios - 'NSInternalInconsistencyException',原因 : 'cannot decode special type ' 14' on pre iOS 11 Devices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53815543/