ios - XCode 7 项目重命名导致 XCTestCase 中出现 'Cannot import module being compiled' 错误

标签 ios xcode swift swift2 xcode7

将我的项目从“Triangles”重命名为“TriX”后,我遇到了所描述的问题:在线 XCTestCase 中出现“无法导入正在编译的模块”错误

@testable import TriX

项目在 Swift 2 中

这是build设置打包部分的截图

enter image description here

有什么办法可以解决吗?

最佳答案

您的测试用例的源代码以某种方式位于模块 TriX 中。您的项目应该(至少)有两个目标:TriX,被测模块和类似 TriXTests 的模块测试。您的测试用例应该只在第二个模块中,而不是在第一个模块中。

关于ios - XCode 7 项目重命名导致 XCTestCase 中出现 'Cannot import module being compiled' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33921341/

相关文章:

ios - 执行 segue : -[UITextField length]: unrecognized selector sent to instance 时出错

ios - 如何在 macOS/iOS 上观察 Night Shift 的变化?

ios - 为 iOS 设备和模拟器构建实际上有何不同?

ios - iOS 12 上不显示图标字体

ios - 无法将类型 ‘NSNull’ (0×106a4f520) 的值转换为 ‘NSDictionary’

ios - 我可以像快速调整常规 View 一样调整贝塞尔路径的大小吗?

ios - 无法将 NSDictionary 值转换为 json

iphone - 用户单击“主页”按钮时如何显示退出确认对话框?

ios - NSMutableArray 中的 NSMutableArray 作为单个对象

ios - 无法使用 CryptoSwift 解密 base64String