从 'Result<AnyObject>' 转换为无关类型 'NSArray' 总是失败

Cast from 'Result<AnyObject>' to unrelated type 'NSArray' always fails

以下代码在 XCode 6/Swift 1 上运行正常,但在 XCode 7/Swift 2

上给我一个错误
Alamofire.request(.POST, "\(self.REQ_URL)", parameters: parameters).validate(contentType: ["application/json"]).responseJSON(options: [], completionHandler: { (req, resp, data) -> Void in

        let data_ar = data as! NSArray //here I get the error 

        })

我得到的错误是

Cast from 'Result' to unrelated type 'NSArray' always fails

我应该如何使用返回的 JSON?

看来语法已经改变了,以下是有效的

Alamofire.request(.POST, "\(self.REQ_URL)", parameters: parameters)
    .responseJSON { request, response, result in
        switch result {
        case .Success(let data):
            let data_ar = data as! NSArray

        case .Failure(let data, let error):
            print("Request failed with error: \(error)")


        }
    }

以防万一你在 xcode 7 分支中使用 swiftyjson,

    Alamofire.request(.POST, "\(self.REQ_URL)", parameters: parameters)
.responseJSON { request, response, result in
    switch result {
    case .Success(let data):
        let json = JSON(data)
        let something = json["aaa"].string
        ....

    case .Failure(let data, let error):
        print("Request failed with error: \(error)")