我試圖在傳統的Objc代碼中測試一些Swift類(@objc類)。我在我的測試類中導入了「UnitTests-Swift.h」。未在UnitTest中找到模塊「MyApp」Swift
然後我得到這個錯誤:
Module "MyApp" not found in the autogenerated "UnitTests-Swift.h"
這是「單元測試,Swift.h」
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
#if defined(__has_feature) && __has_feature(modules)
@import XCTest;
@import ObjectiveC;
@import MyApp;
@import CoreData;
#endif
我清理項目的頂部內什麼,檢查了所有相關的標誌("No such module" when using @testable in Xcode Unit tests,Can't use Swift classes inside Objective-C),刪除派生數據等..不知道發生了什麼,但我很確定@import MyApp不應該在那裏..
C任何人都可以幫助我?
我也有這個問題。 – Uncommon
通過請求,我已經在Swift錯誤數據庫中提交了這個:https://bugs.swift。org/browse/SR-3381 – Uncommon
這是可以在Xcode 7中複製的東西,還是需要使用舊版本製作的obj-c項目?你能否提供從頭開始重現的步驟? – charmingToad