gpt4 book ai didi

ios - 通用 Swift 序列类型生成器

转载 作者:行者123 更新时间:2023-11-30 13:05:00 24 4
gpt4 key购买 nike

我在尝试运行此代码时遇到一些问题,我发现了几个使用相同代码的示例,但出现编译器错误

架构arm64的 undefined symbol : “ExpSwift.SearchResults.generate () -> Swift.IndexingGenerator<[A]>”,引用自: ViewController.o 中的 ExpSwift_Example.ViewController.(viewDidLoad () -> ()).(closure #1).(closure #3)ld:未找到架构 arm64 的符号clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

这是我的代码类

public final class SearchResults<T> {

var results = [T]();
let total: Int64

required public init?(results: [T], total: Int64) {
self.results = results
self.total = total
}

public func getResults() -> [T] {
return self.results
}

public func getTotal() -> Int64 {
return self.total
}

}


extension SearchResults : SequenceType {
public func generate() -> IndexingGenerator<Array<T>> {
return results.generate()
}
}

然后用 Alamofire 调用它

ExpSwift.findLocations(["limit":10, "skip":0, "sort":"name"]).then { (locations: SearchResults<Location>) -> Void in
for location:Location in locations{
debugPrint(location.get("name"))
}

}.error { error in
debugPrint(error)
}

最佳答案

看起来只是 cocoapods 或 Xcdoe 的东西,对我来说,解决方案就是更新 Xcode 8 并下载 Xcode 7.3 。如果我使用 Xcode 7.3,请修复编译器的问题。我尝试了几次构建,​​几次后就成功了。

关于ios - 通用 Swift 序列类型生成器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39498274/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com