【发布时间】:2019-07-08 19:25:09
【问题描述】:
我正在尝试在 Xcode 中建立一个支持 Thrift 0.12 和 Swift 4.2 的新项目。在我由 Thrift 生成的 swift 文件中,它们都有“import Thrift”行,但我得到一个编译错误“没有这样的模块'Thrift'”。我不知道如何解决这个问题。将 Thrift 作为 cocoapod 导入似乎不起作用,因为我可以通过 pod 下载的最新版本似乎是 0.10,它不支持 Swift 4.2。我将 Thrift 0.12 下载到我的 Mac 上,这就是我首先生成 thrift-to-swift 文件的方式。以下是生成的文件之一。
我尝试过:
pod "Thrift" 和
pod 'Thrift-swift3', :git => 'git@github.com:apache/thrift.git', :branch => 'master'
它们都不起作用。
我生成的 swift 文件:
import Foundation
import Thrift
public final class TTestMessage {
public var title: String?
public var message: String?
public init() { }
public init(title: String?, message: String?) {
self.title = title
self.message = message
}
}
【问题讨论】:
标签: ios swift xcode import thrift