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;

    }

  • 相关阅读:
    P1443 马的遍历
    P1747 好奇怪的游戏
    蜀绣
    Five hundred miles
    如果没有你
    Yellow
    流星

    深入理解计算机中的 csapp,h和csapp.c
    可迭代的集合类型使用foreach语句
  • 原文地址:https://www.cnblogs.com/OIMM/p/15818484.html
Copyright © 2011-2022 走看看