issues
search
BAHome
/
BAWKWebView
用分类封装 WKWebView,一行代码搞定 request、URL、URLString、本地 HTML文件、HTMLString等请求,一个 block 搞定 title、progress、currentURL、当前网页的高度等等所需
MIT License
219
stars
33
forks
source link
WKWebView swizzled -dealloc 崩溃
#5
Open
ocyisheng
opened
6 years ago
ocyisheng
commented
6 years ago
(void)load { // BAKit_Objc_exchangeMethodAToB(NSSelectorFromString(@"init"), @selector(ba_web_init)); // BAKit_Objc_exchangeMethodAToB(NSSelectorFromString(@"initWithFrame"), @selector(ba_web_initWithFrame)); BAKit_Objc_exchangeMethodAToB(NSSelectorFromString(@"dealloc"), @selector(ba_web_dealloc));
}
(void)ba_web_dealloc { //1.这里需要判断是否已经添加了observe if(hadAddObserve){ [self ba_removeNoti]; } //2.在之后应该调用ba_web_dealloc [self ba_web_dealloc]; }
lwq1365102044
commented
4 years ago
解决了吗?
ocyisheng
commented
4 years ago
解决了吗?
需要判断观察者是否存在,再移除就没事了
}