程序运行时,莫名其妙崩溃,打断点也没效果......
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"];
}
网友评论