I got this “Too Many arguments to function call, expected 0, have 3” error while compiling a project relies on QuickDialog.

According “https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html”, it is easy to fix, just cast the function to right prototype, like:

int (*action)(id, SEL, int) = (int (*)(id, SEL, int)) objc_msgSend;

But, the invocation is in a pod project which is locked for editing and even if I unlock it, the change will lose at next checking out of the project.

Further peek at objc/message.h shows it is a trick to help compiler ensuring the call is with right frame, the signature is still available with OBJC_OLD_DISPATCH_PROTOTYPES micro. Then I found the:Screen Shot 2015-06-12 at 9.27.25 AM

Set “Enable Strict Checking of objc_msgSend Calls” in QuickDialog target of Pod project, done.


This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • I don’t know what you are talking about, but it appears as if you hacked rocket science with a screw driver…

  • CocoaPods is not good as what it got looked. Many caves.