ios - 在 WatchKitExtension 中混合 swift 和 objective-c

标签 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 扩展一起工作? 谢谢!

最佳答案

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

关于ios - 在 WatchKitExtension 中混合 swift 和 objective-c,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28642268/

相关文章:

ios - 检索 customCell 标签文本值

swift - 核心动画,self.presentationLayer()为nil

ios - UIView.animate 不延迟显示 View

ios - ReactiveCocoa : Immediately send the latest value when there's a new subscription

ios - 将目标添加到 UIRefreshControl()

ios - 在 View Controller 之间传递数据

ios - 以编程方式将 subview 添加到 UICollectionView

ios - 在整个应用程序中重新调用应用程序委托(delegate)

ios - 在 swift 2 中按下导航栏后退按钮时重新加载 View Controller

ios - 像 Google Analytics 一样在 UIViewController 上跟踪用户使用时间和时间