【问题标题】:XCode 12 error with IMP instance: Too many arguments to function call, expected 0, have 2IMP 实例的 XCode 12 错误:函数调用的参数过多,预​​期为 0,有 2
【发布时间】:2021-07-21 07:41:07
【问题描述】:

我刚刚为旧项目做了一些工作。 IMP 实例存在编译时错误:

在寻找原因和解决方案时,我遇到了链接:

https://developer.apple.com/forums/thread/666701

但这些并没有帮助我理解解决方案。应该怎么做才能消除错误?

【问题讨论】:

    标签: ios objective-c compiler-errors imp


    【解决方案1】:

    https://developer.apple.com/forums/thread/666988 给出的解决方案对我有用。有一些警告,但至少构建成功。

    id (*grannyImp)(Class, SEL) = (id(*)(Class,SEL))class_getMethodImplementation(granny, _cmd);
    //IMP grannyImp = class_getMethodImplementation(granny, _cmd);
    grannyImp(self, _cmd); 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-27
      • 1970-01-01
      相关资源
      最近更新 更多