0
我正在學習iOS,現在有一個爲應用程序構建UITest的問題。下面粘貼的代碼將編譯,如果我刪除了var viewController:ViewController!字段,但添加它時失敗。當我點擊錯誤信息時,它會將我帶到PasswordManagerUITests項目的「Build Phases」部分。我在下面的項目中包含了錯誤和Build階段的屏幕截圖。clang:錯誤:鏈接器命令失敗,退出代碼1(使用-v查看調用); 「__TMaC15PasswordManager14ViewController」,引用自:
import XCTest
@testable import PasswordManager
class ViewControllerTestCase: XCTestCase {
var viewController: ViewController!
override func setUp() {
super.setUp()
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}