我有一个部分用 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 $S14test_app18CardViewControllerC11resetLayout33_2E2D3FEF56CDB4998F73949398E4FE67LLyyF (CardViewController.swift:103)
19 ole-consignado 0x100e327b4 $S14test_app18CardViewControllerC17viewWillDisappearyySbF (CardViewController.swift:73)
20 ole-consignado 0x100e32804 $S14test_app18CardViewControllerC17viewWillDisappearyySbFTo (<compiler-generated>)
21 UIKitCore 0x23ef39068 (Missing)
43 CoreFoundation 0x2122f87cc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
44 CoreFoundation 0x2122f3460 __CFRunLoopDoObservers
45 CoreFoundation 0x2122f3a00 __CFRunLoopRun
46 CoreFoundation 0x2122f31f0 CFRunLoopRunSpecific
47 GraphicsServices 0x21456c584 GSEventRunModal
48 UIKitCore 0x23f4fad40 (Missing)
49 ole-consignado 0x100b37f74 main (main.m:14)
50 libdyld.dylib 0x211db2bb4 start
所以我的问题是任何人之前遇到过崩溃并有解决方案建议?