程序運行時,莫名其妙崩潰,打斷點也沒效果......
libc++abi.dylib: terminate_handler unexpectedly threw an exception報這個錯誤的原因有很多,我的原因是使用KVO之后,沒有移除觀察者!
[self.webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
在dealloc中一定要移除觀察者!!!!
- (void)dealloc{
? ? [self.webView removeObserver:self forKeyPath:@"estimatedProgress"];
}