panghaijiao / HJCornerRadius

A category for UIImageView with support for cornerRadius automatically
http://www.olinone.com/?p=484
464 stars 66 forks source link

dealloc并没有调用啊。 #8

Closed Tanyd closed 8 years ago

Tanyd commented 8 years ago
panghaijiao commented 8 years ago

什么意思? dealloc没有调用?你是ARC工程吗?

BMMax commented 8 years ago

pop后,程序蹦,提示没有销毁kvo,-(void)dealloc { [self.originImageView removeObserver:self forKeyPath:@"image"]; [self.originImageView removeObserver:self forKeyPath:@"contentMode"]; } 并没有调用.

panghaijiao commented 8 years ago

应该不至于吧,我这么没有发现,找到原因了吗

cnxbox360 commented 8 years ago

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 8 years ago

这个应该不至于吧?这里没有用到多线程