在WatchKitExtension中混合使用swift和objective-c

时间:2015-02-21 04:57:11

标签: ios objective-c swift watchkit ios-extensions

我在WatchKit扩展程序中收到警告和错误:

Warning: no rule to process file 'App-Bridging-Header.h' of type sourcecode.c.h for architecture x86_64

/Users/janusz/Desktop/Repositories/RunnerAppWatch/Source/WormholeMessanger.swift:12:20: Use of unresolved identifier 'MMWormhole'

Bridge Header

它也列在“编译源”部分中。

当我删除WatchKit扩展程序时,一切正常,但是一旦我将其添加回来,我又会遇到错误。 所以问题是:如何使用WatchKit扩展使桥接头工作? 谢谢!

1 个答案:

答案 0 :(得分:3)

桥接标头不得包含在Compiled Sources部分中。通常,不应将标头添加到Compiled Sources。所以,删除它,它应该工作。