我尝试将我的Unity3D项目导出为iOS,但我一直收到此错误:
No matching function for call to 'objc_msgSendSuper'
[DIRECTORY]/Classes/UI/UnityViewControllerBase+iOS.mm:166:5: No matching function for call to 'objc_msgSendSuper'
[DIRECTORY]/Classes/UI/UnityViewControllerBase+iOS.mm:180:5: No matching function for call to 'objc_msgSendSuper'
[DIRECTORY]/Classes/UI/UnityViewControllerBase+iOS.mm:210:5: No matching function for call to 'objc_msgSendSuper'
我还得到以下提示:
[DIRECTORY]/Classes/Unity/ObjCRuntime.h:20:43: Expanded from macro 'UNITY_OBJC_FORWARD_TO_SUPER'
[DIRECTORY]/Classes/Unity/ObjCRuntime.h:11:60: Expanded from macro 'UNITY_OBJC_SEND_MSG'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/message.h:65:1: Candidate function not viable: requires 0 arguments, but 4 were provided
XCode标记以下代码行:
UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(willRotateToInterfaceOrientation:duration:), WillRotateToInterfaceOrientationSendFunc, toInterfaceOrientation, duration);
和
UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(didRotateFromInterfaceOrientation:), DidRotateFromInterfaceOrientationSendFunc, fromInterfaceOrientation);
和
UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(viewWillTransitionToSize:withTransitionCoordinator:), ViewWillTransitionToSizeSendFunc, size, coordinator);
我已经测试过在模拟的iPhone X(iOS 11.4)上构建应用程序。
有谁能告诉我如何解决这个问题?
MacOS:HighSierra 10.13.4 Unity3D(个人):2018.1.1f1 XCode:9.4
答案 0 :(得分:6)
我在Unity 2018.1.3上有同样的问题
关闭"启用严格检查objc_msgSendCalls"管理以在模拟器上编译和运行选项(在项目 - > Apple LLVM 9.0预处理下)。
我对iOS本地开发知之甚少,所以忽略这些错误可能会很糟糕。我试图降级到Unity 2017.3.1但我没有 这些错误。