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;

    }

  • 相关阅读:
    0808 HTML 基础
    2016.8.3 C#基础 结构体,枚举类型
    2016.8.1 C#基础 传值
    2016.7.22
    2016.7.20
    2016.7.31C#基础 函数
    2016.07.30C#基础 特殊集合
    2016.7.28C#基础 集合
    个人项目网页3
    个人项目网页2
  • 原文地址:https://www.cnblogs.com/OIMM/p/15818484.html
Copyright © 2011-2022 走看看