IMP 实例的 XCode 12 错误:函数调用的参数太多,预期为 0,有 2 个

问题描述

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

enter image description here

在寻找原因和解决方案时,我发现了以下链接:

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

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

解决方法

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); 

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...