2016-09-14 32 views
0

我有一些问题,试图运行这段代码,我发现使用相同的代码例子,但是我得到的编译器错误架构arm64序列类型发电机通用斯威夫特

未定义的符号: “ExpSwift.SearchResults。在ViewController.o中生成() - > Swift.IndexingGenerator < [A]>“,引用自: ExpSwift_Example.ViewController。(viewDidLoad() - >())。(closure#1)。(closure#3) ld :符号(s)找不到架构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) 
     } 
+0

该代码在我的Xcode 7.3.1中没有问题编译,问题必须在其他地方。 –

+0

我正在做这个位置:位置 {debugPrint(location.get(“name”)) }我也使用xcode 7.3.1 –

+0

您使用的是哪个版本的Xcode? – ColGraff

回答

0

看起来只是一些与的CocoaPods或Xcdoe,对我来说,解决刚更新的Xcode 8和下载Xcode 7.3。如果我使用Xcode 7.3修复了编译器的问题。我尝试了几次来建立,然后在几次运行之后运行。