dealloc并没有调用啊。
Closed this issue · 5 comments
Tanyd commented
- (void)dealloc { [self.originImageView removeObserver:self forKeyPath:@"image"]; [self.originImageView removeObserver:self forKeyPath:@"contentMode"]; }
panghaijiao commented
什么意思? dealloc没有调用?你是ARC工程吗?
BMMax commented
pop后,程序蹦,提示没有销毁kvo,-(void)dealloc { [self.originImageView removeObserver:self forKeyPath:@"image"]; [self.originImageView removeObserver:self forKeyPath:@"contentMode"]; }
并没有调用.
panghaijiao commented
应该不至于吧,我这么没有发现,找到原因了吗
cnxbox360 commented
An instance 0x15475ac00 of class UIImageView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x17085a340> (
<NSKeyValueObservance 0x1702d2440: Observer: 0x15475ac00, Key path: image, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x17024f9f0>
)在keyWindow切换主控制器时,有几率发生. ImageView只有这里用了KVO.
是不是由于addObserver调用了2次导致,在多线程处理时?
panghaijiao commented
这个应该不至于吧?这里没有用到多线程