加載html的時候,用weibiew加載,如果CSS文件里邊用到了這個屬性:
-webkit-overflow-scrolling: touch(這個屬性是實現(xiàn)彈性的滑動,類似scrollview的bounces效果);加載的時候,會提示這個錯誤,如果你不打全局斷點,程序是不會崩潰的,如果有,就會崩潰.
解決辦法:
1----如果能去掉html里邊的這個屬性,就去掉
2----如果不能去掉,其實也沒什么,真機運行也沒什么問題的,不影響大局
3----如果你支持的最低版本是iOS8,那么你可以用WKWebView來代替UIWebView,WK沒有這個問題
4----報錯是說類沒有實現(xiàn)這個方法,那么,我們可以自己實現(xiàn)一下,給UIWebView增加一個category,用runtime來給這個類添加這個方法實現(xiàn)
+ (void)load{
// "v@:"
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@:");
}
id setBeingRemoved(id self, SEL selector, ...)
{
return nil;
}
id willBeRemoved(id self, SEL selector, ...)
{
return nil;
}