在XCode6下,写了如下一段代码:
1 2 3 |
|
总是报错
“Too many arguments to function call, expected 0, have 2”
后来发现在使用objc_msgSend编译时,与IMP报错类似。
原来是LLVM升级后,增加一些默认设置
objc_msgSend without a typecast is usually an error
Recommended build setting for strict checking
那我们在Build Setting–>Apple LLVM 6.0 – Preprocessing下,把Enable Strict Check for objc_msgSend Call设置为NO
即可。