Xcode 8 Ambiguous expansion of macro NSLocalizedString

為{幸葍}努か 提交于 2019-12-05 05:39:35

I eventually got it all working again.

Let’s pretend our project is called Panda and it consists of both Obj-C and Swift files. All of those files are in both our Panda and PandaTests target.

STEP 1: Ensure all your files have the right Target Membership i.e. Panda target: Only the source files, development frameworks, images etc and PandaTests target: Only the test files, testing frameworks, mock data etc

STEP 2: Ensure your Panda Project has the Build Settings -> Enable Testability set to Yes.

STEP 3: Ensure your PandaTests Project has the Build Settings -> Product Module Name set to PandaTests.

STEP 4: Do a nice clean by holding down the Option button and then clicking on Product. You should see a Clean Build Folder option.

STEP 5: For Swift Unit Tests, add @testable import Panda. Since we have now removed all our source code files from the PandaTests target, the unit tests need a way of accessing our project files. This enables our Swift unit tests to access all our Swift files and those Obj-C files that have been included in our Panda-Bridging-Header.h.

Looks like following is solved the issue, but not sure what are the side effects.

Xcode Build Settings and Set

Other C Flags -Wno-ambiguous-macro

HTH

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!