An instance 0xca90200 of class UILabel was deallocated while key value observers were still registered with it
一個錯誤,大意是UILabel被內(nèi)存釋放后,它得值依然在被觀察
原因是給UILabel增加了個監(jiān)聽事件
[self.valueLabel addObserver:self
forKeyPath:@"text"
options:NSKeyValueObservingOptionNew
context:nil];
然后在UIView被pop后,監(jiān)聽時間沒有停止,解決辦法為:
- (void)dealloc
{
[_valueLabel removeObserver:self forKeyPath:@"text"];
}