devedbox / AXWebViewController

AXWebViewController is a webViewController to browse web content inside applications. It’s a lightweight controller on iOS platform based on WKWebView (UIWebView would be the base Kit under iOS 8.0). It added navigation tool bar to refresh, go back, go forward and so on. It support the navigation style on WeChat. It is a simple-using and convenient web view controller using inside applications.
MIT License
798 stars 134 forks source link

修复dealloc方法移除通知时崩溃bug #76

Open zhangjk4859 opened 6 years ago

zhangjk4859 commented 6 years ago

报错信息《Cannot remove an observer <AXWebViewController 0x106060200> for the key path estimatedProgress》

devedbox commented 5 years ago

存在这个问题吗?

tentenlee100 commented 5 years ago

@devedbox 有遇過這問題,當你把webview當作TabbarController的一個ViewController時會發生有還沒viewDidLoad所以KVO還沒建立,但要dealloc時就抓不到kvo的key就crash了,需要這個判斷。

只是這pr裡面還有改其他東西不只這些而已,我自己是在dealloc裡面加上try catch就可以解決了。

tentenlee100 commented 5 years ago

@devedbox 剛建立一個只修改這個問題的pr了

zhangjk4859 commented 5 years ago

存在这个问题吗?

是的,把AX当做tabbar的child view controller就会崩溃,需要在dealloc方法里加一个判断