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

XCode 7 project renamed results in 'Cannot import module being compiled' error in XCTestCase

将我的项目从 'Triangles' 重命名为 'TriX' 后,我遇到了所描述的问题:'Cannot import module being compiled' XCTestCase on line

中的错误
@testable import TriX

项目在 Swift 2

这是构建设置打包部分的屏幕截图

有什么办法可以解决吗?

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