Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift2 架构x86_64的未定义符号,用于带有Alamofire.Request的扩展_Swift2_Linker Errors_Alamofire - Fatal编程技术网

Swift2 架构x86_64的未定义符号,用于带有Alamofire.Request的扩展

Swift2 架构x86_64的未定义符号,用于带有Alamofire.Request的扩展,swift2,linker-errors,alamofire,Swift2,Linker Errors,Alamofire,我为Alamofire.Response创建了一个协议,然后像这样扩展它 import Alamofire public protocol MyResponseType { typealias Value typealias Error: ErrorType var request: NSURLRequest? { get } var response: NSHTTPURLResponse? { get } var data: NSData? { get

我为
Alamofire.Response
创建了一个协议,然后像这样扩展它

import Alamofire
public protocol MyResponseType {
    typealias Value
    typealias Error: ErrorType
    var request: NSURLRequest? { get }
    var response: NSHTTPURLResponse? { get }
    var data: NSData? { get }
    var result: Alamofire.Result<Value, Error> { get }
    init(request: NSURLRequest?, response: NSHTTPURLResponse?, data: NSData?, result: Alamofire.Result<Value, Error>, timeline: Alamofire.Timeline)
}

extension Alamofire.Response: MyResponseType {}
导入Alamofire
公共协议MyResponseType{
类型别名值
typealias错误:ErrorType
var请求:NSURLRequest?{get}
var响应:NSHTTPURLResponse?{get}
变量数据:NSData?{get}
var result:Alamofire.result{get}
初始化(请求:NSURLRequest?,响应:NSHTTPURLResponse?,数据:NSData?,结果:Alamofire.result,时间线:Alamofire.timeline)
}
扩展Alamofire.Response:MyResponseType{}
构建过程通过了,但当涉及到链接时,它失败了。错误来了

Undefined symbols for architecture x86_64:
  "Alamofire.Response.data.getter : __ObjC.NSData?", referenced from:
      protocol witness for wtftest. MyResponseType.data.getter : __ObjC.NSData? in conformance <A, B where B: Swift.ErrorType> Alamofire.Response<A, B> : wtftest. MyResponseType in wtftest in ViewController.o
  "Alamofire.Response.result.getter : Alamofire.Result<A, B>", referenced from:
      protocol witness for wtftest. MyResponseType.result.getter : Alamofire.Result<A.Value, A.Error> in conformance <A, B where B: Swift.ErrorType> Alamofire.Response<A, B> : wtftest.ProducerResponseType in wtftest in ViewController.o
  "Alamofire.Response.request.getter : __ObjC.NSURLRequest?", referenced from:
      protocol witness for wtftest. MyResponseType.request.getter : __ObjC.NSURLRequest? in conformance <A, B where B: Swift.ErrorType> Alamofire.Response<A, B> : wtftest. MyResponseType in wtftest in ViewController.o
  "Alamofire.Response.response.getter : __ObjC.NSHTTPURLResponse?", referenced from:
      protocol witness for wtftest. MyResponseType.response.getter : __ObjC.NSHTTPURLResponse? in conformance <A, B where B: Swift.ErrorType> Alamofire.Response<A, B> : wtftest.ProducerResponseType in wtftest in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
架构x86_64的未定义符号: “Alamofire.Response.data.getter:\uu ObjC.NSData?”,引用自: wtftest的协议见证。MyResponseType.data.getter:\uu ObjC.NSData?响应:wtftest。ViewController.o中wtftest中的MyResponseType “Alamofire.Response.result.getter:Alamofire.result”,引用自: wtftest的协议见证。MyResponseType.result.getter:Alamofire.result符合Alamofire.Response:wtftest.ProducerResponseType in wtftest in ViewController.o “Alamofire.Response.request.getter:\uu ObjC.NSURLRequest?”,引用自: wtftest的协议见证。MyResponseType.request.getter:\uu ObjC.NSURLRequest?响应:wtftest。ViewController.o中wtftest中的MyResponseType “Alamofire.Response.Response.getter:\uu ObjC.NSHTTPURLResponse?”,引用自: wtftest的协议见证。MyResponseType.response.getter:\uu ObjC.nshtpurlResponse?一致性中的Alamofire.Response:wtftest.ProducerResponseType在ViewController.o中的wtftest中 ld:找不到架构x86_64的符号 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用)
这是斯威夫特的虫子吗?还是我做错了什么?

请提及
ProducerResponseType
too@SohilR.Memon对不起,
ProducerResponseType
实际上是我的responsetype,忘了修改它了,关于这一点,我的头也撞到墙上了。仅在瞄准模拟器时失败,但设备仍能正常工作。