How to access Core Data generated Obj-C classes in test targets?

后端 未结 3 512
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 06:14

I have a Core Data / Swift Cocoa application project in Xcode 6 (let\'s call the project Stuff). I created a Core Data entity called Query and used Xco

3条回答
  •  盖世英雄少女心
    2021-01-21 06:58

    Took me a while to figure this out. The ideal solution is to import the bridging header in the test target itself. Go in Build Settings > Swift compiler > Code Generation and give the name of your bridging header. Be careful, the test target is not selected by default. You have to select it in the scrollbar (it's located on the same line as General, info, build Settings, build Phases, and Build Rules). This way, you will have the same bridging header for both your project and your different test targets.

提交回复
热议问题