美文网首页
objc_msgSend exc_bad_access(code

objc_msgSend exc_bad_access(code

作者: cezr | 来源:发表于2017-01-04 23:04 被阅读140次
    /// 模拟器上报错,真机运行无误
    /// Error: exc_bad_access(code=exc_i386_gpflt)
    ((UIEdgeInsets (*)(Class, SEL, id))objc_msgSend)(class, @selector(insetForContent:), content);
    
    /// 改为
    #ifdef __arm64__
        return ((UIEdgeInsets (*)(Class, SEL, id))objc_msgSend)(class, @selector(insetForContent:), content);
    #else
        return ((UIEdgeInsets (*)(Class, SEL, id))objc_msgSend_stret)(class, @selector(insetForContent:), content);
    #endif
    

    参考

    相关文章

      网友评论

          本文标题:objc_msgSend exc_bad_access(code

          本文链接:https://www.haomeiwen.com/subject/uhyovttx.html