Swift错误:'(AFHTTPRequestOperation!,NSError?) - >不能转换为'((AFHTTPRequestOperation?,NSError) - > Void?

时间:2015-11-23 12:24:11

标签: ios objective-c swift afnetworking afnetworking-2

我在swift中使用AFNetworking,我在将以下代码转换为swift时面临问题

目标C

[client GET:url parameters:nil success:^(AFHTTPRequestOperation * _Nonnull operation, id  _Nonnull responseObject) {

} failure:^(AFHTTPRequestOperation * _Nullable operation, NSError * _Nonnull error) {

}];

Swift Code (出错)

self.client.GET(url,
        parameters: nil,
        success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) in

        },
        failure: { (operation: AFHTTPRequestOperation!, error: NSError!) in

    })

0 个答案:

没有答案