1
我有兩個目標爲手錶操作系統和不帶手錶。 我必須輸入briding header as。消息util已被添加到兩個目標。但它給編譯器錯誤爲在多個目標之間導入不同的橋接標頭
「使用未聲明的標識符MessageUtil」。
#import "SomeClass.h"
#ifdef TARGET_OS_WATCH
#import "Watch-Header.h"
#import "With_Watch-Swift.h"
#elif TARGET_OS_IOS
#import "Without_Watch-Header.h"
#import "Without_Watch-Swift.h"
#endif
@implementation SomeClass
-(id)init {
self = [super init];
if(self) {
self.message = [MessageUtil messageOne];//MessageUtil is swift class.
}
return self; }
@end
什麼設置爲'SomeClass'的目標是什麼? – nayem
ComeClass有多個目標。 – boom
嘗試從'#ifdef'到'#endif'中刪除所有內容,並導入''WithUWatch-Swift.h''和''Without_Watch-Swift''中的'MessageUtil'所在的任何一個。 – nayem