objc_msgSend()报错Too many arguments to function call

问题:

在使用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 arguments to function call)