zoukankan      html  css  js  c++  java
  • [WebActionDisablingCALayerDelegate willBeRemoved]: unrecognized selector sent to instance xxxxx

    WebActionDisablingCALayerDelegate类找不到相应的方法实现,提示 [WebActionDisablingCALayerDelegate willBeRemoved]: unrecognized selector sent to instance xxxxx

    用weibiew加载html的时候,如果CSS文件里边用到了这个属性:

    -webkit-overflow-scrolling: touch(这个属性是实现弹性的滑动,类似scrollview的bounces效果);加载的时候,会提示这个错误,如果你不打全局断点,程序是不会崩溃的,如果有,就会崩溃.

    解决办法:

    1----html里面去掉这个属性,如果不去掉也没事,真机运行不会崩溃

    2----用WKWebView来代替UIWebView

    3----报错是说类找不到相应的方法实现,那么可以自己实现一下,给UIWebView增加一个category,用runtime来给这个类添加这个方法实现

    + (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@:");

    }

    id setBeingRemoved(id self, SEL selector, ...) {

    return nil;

    }

    id willBeRemoved(id self, SEL selector, ...) {

    return nil;

    }

  • 相关阅读:
    修改Ubuntu从文本界面登录
    Putty等工具中解决SSH连接超时断开的问题
    QoS policy-map class-map
    Linux中的do{...} while(0)
    手动增加swap分区
    __attribute__ 机制详解(一)
    欢迎来语雀关注我
    WebForm 生成并显示二维码
    《C#图解教程》 总览
    C#图解教程 第二十五章 其他主题
  • 原文地址:https://www.cnblogs.com/OIMM/p/15818484.html
Copyright © 2011-2022 走看看