美文网首页
objc_msgSend()报错Too many argumen

objc_msgSend()报错Too many argumen

作者: 知本集 | 来源:发表于2016-12-28 21:33 被阅读29次

问题:

在使用runtime的时候出现错误:

Too many arguments to function call。。。。。

解决方法:

Build Setting--> Apple LLVM 8.0 - Preprocessing--> Enable Strict Checking of objc_msgSend Calls  改为 NO

注意:runtime调用方法时依然遵循类调用方法的规则。

例如:

PersonViewController*person = [[PersonViewController alloc]init];

objc_msgSend(person,@selector(logFucntion));//调用实例方法

objc_msgSend([PersonViewController class],@selector(logFunctionPlus));//调用类方法

相关文章

网友评论

      本文标题:objc_msgSend()报错Too many argumen

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