? ?公司app內(nèi)嵌套了網(wǎng)頁(yè)璧坟,在一次開發(fā)自測(cè)中突然發(fā)現(xiàn)出現(xiàn)了一個(gè)崩潰,app是在VC中加入了UIWebView而已乃正,
報(bào)錯(cuò)信息
[WebActionDisablingCALayerDelegate willBeRemoved]: unrecognized selector sent to instance 0x158101cc0?
一看是對(duì)象提前釋放了谦铃。啦辐。卓嫂。 可關(guān)鍵是我都沒調(diào)用這個(gè)方法慷暂。。
最后問公司前端晨雳,說加了很多東西在app調(diào)用的網(wǎng)頁(yè)行瑞,初步估計(jì)是這方面原因。悍募。(希望有知道的大神告知 感謝??)
后查找要UIWebView添加 category .m代碼如下
+ (void)load {
? ? ? ?Class class = NSClassFromString(@"WebActionDisablingCALayerDelegate");
? ? ? ?class_addMethod(class,@selector(setBeingRemoved),setBeingRemoved,"v@:");
? ? ? ?class_addMethod(class,@selector(willBeRemoved),willBeRemoved,"v@:");
? ? ? ? class_addMethod(class,@selector(removeFromSuperview),willBeRemoved,"v@:");
}
idsetBeingRemoved(idself,SELselector, ...)
{
? ? return nil;
}
idwillBeRemoved(idself,SELselector, ...)
{
? ? return nil;
}
這樣就沒有問題了。洋机。坠宴。。
?? 筆記