UITextField initWithFrame上的KVO崩溃

我的应用程序的客户发给我这个奇怪的崩溃报告,我无法弄清楚这会如何崩溃。 我不能自己重现这个问题,所以我依靠崩溃报告。

它崩溃在以下非常简单的代码行:

UITextField *value = [[UITextField alloc] initWithFrame:frame]; 

崩溃似乎与键值观察(KVO)有关,但我在这里没有做任何事情。 这是一个简单的构造函数! 唯一可能的情况是,另一个线程正在写入一个dealloc'ed对象,该对象和initWithFrame:创build的对象具有相同的内存地址initWithFrame: 。 但在崩溃报告中,所有其他线程都很安静。

我发现了其他类似的问题,但他们都没有答案。

有任何想法吗?

这里是崩溃报告的相关部分:

 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010 Triggered by Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libobjc.A.dylib 0x0000000181981b90 objc_msgSend + 16 1 Foundation 0x0000000182bf2454 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 324 2 QuartzCore 0x0000000184deb11c CA::Layer::set_delegate(objc_object*) + 72 3 UIKit 0x0000000187456f40 -[UIView _createLayerWithFrame:] + 580 4 UIKit 0x0000000187456a00 UIViewCommonInitWithFrame + 688 5 UIKit 0x00000001874566f0 -[UIView initWithFrame:] + 140 6 UIKit 0x000000018745dfb0 -[UILabel initWithFrame:] + 48 7 UIKit 0x0000000187542064 -[UITextField createTextLabelWithTextColor:] + 76 8 UIKit 0x0000000187541c30 -[UITextField initWithFrame:] + 416 9 Flyskyhy 0x00000001000e1f68 -[ElementView doInitWithUnit:] (ElementView.m:178)