0
我正在使用xcode 7.3和swift 2.3。爲了建立網絡連接,我使用'Alamofire','〜> 3.4.1'。直到我執行歸檔選項時,我纔會遇到問題。我正在和Xcode的標記在--->標記這個錯誤由於信號命令失敗:分段錯誤:11:alamofire post
命令失敗,原因是信號:分段故障:11
class func post(url: String, headers:[String: String], parameters:[String: AnyObject], success:(AnyObject)->(), failure:(AnyObject)->()) ->() {
---> Alamofire.request(.POST,
url,
headers:headers,
parameters:parameters,encoding:.URL)
.debugLog()
.validate(statusCode: 200..<300)
.responseString { response in
response.debugLog()
switch response.result{
case .Success(_):
//print(response)
let httpResponseBody = response.result.value! as String
success(httpResponseBody)
case .Failure(_):
let error = response.result.error
//print(error)
failure(error!)
}
}