我有一个部分用 Swift 3.2 编写的应用程序和使用 xcode 10 构建的 Objective-c,我在一些 Swift ViewControllers 中发生了奇怪的崩溃,在我收集的日志中,发生崩溃的那一行是我在 UILabel 上设置文本 (valueLabel.text = "-")(UILabel 是正常的,没有继承,也没有任何自定义)。
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x212368ec4 __exceptionPreprocess
1 libobjc.A.dylib 0x211539a40 objc_exception_throw
2 CoreFoundation 0x21226f594 -[NSCache init]
3 UIKitCore 0x23f14fba0 (Missing)
4 UIKitCore 0x23f14fc3c (Missing)
5 UIFoundation 0x21c9ca778 attributeDictionaryHash
6 Foundation 0x212dc8074 hashProbe
7 Foundation 0x212ce5c24 -[NSConcreteHashTable getItem:]
8 UIFoundation 0x21c975548 +[NSAttributeDictionary newWithDictionary:]
9 UIFoundation 0x21c9778e4 -[_NSCachedAttributedString initWithString:attributes:]
10 UIFoundation 0x21c9e5b98 __NSStringDrawingEngine
11 UIFoundation 0x21c9697e4 -[NSString(NSExtendedStringDrawing) boundingRectWithSize:options:attributes:context:]
12 UIKitCore 0x23f90c9a0 (Missing)
18 ole-consignado 0x100e336ac …Run Code Online (Sandbox Code Playgroud)