我有一个项目,在我尝试进行单元测试之前构建得很好。当我“构建测试”时,我遇到了一些错误。例如 Swift 的这几行
@IBOutlet weak var panAndZoomView: SegmentationPanAndZoomView!
@IBOutlet weak var toolbarView: SegmentationToolbarView!
给出两个构建错误:
Use of undeclared type 'SegmentationPanAndZoomView'
'weak' may only be applied to class and class-bound protocol types, not '<<error type>>'
我已包含
@testable import Thinga_Me
输入产品模块名称(如 Kostapappas Lampros 对 Swift 2 + Xcode 7: Unit Testing Access Made Easy 的评论中所建议的那样),并且我设置了测试目标主机应用程序,并选中了“允许测试主机应用程序 API”。我也通读了Apple文档Testing with Xcode的相关章节.
考虑到“构建运行”没有问题,我缺少什么才能让这个应用程序“构建用于测试”?
最佳答案
关于xcode - Swift 单元测试和 "build for testing"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36403758/