函数的manager.GET报错

来源:6-1 使用AFNetworking

gdjy098

2015-12-02 20:39

函数的manager.GET报错 manager.GET 报错,Cannot invoke 'GET' with an argument list of type '(String, parameters: NSDictionary, success: (AFHTTPRequestOperation!, AnyObject!) -> _, failure: (AFHTTPRequestOperation!, NSError!) -> _)'   具体应该怎么改?谢谢!

写回答 关注

6回答

  • CoderDream
    2018-11-12 10:45:35

    上面的代码运行结果如下:

    https://img4.mukewang.com/5be8e9230001cc2c10060684.jpg

  • CoderDream
    2018-11-12 10:44:14

            manager.get(url,

                        parameters: params,

                        success: { (operation: AFHTTPRequestOperation,

                            responseObject: Any) in

                            var info = responseObject as? NSDictionary

                            print(info);

                            print("OK")

            },


  • 来自蒙塔基的罡蛋
    2016-02-09 16:10:22

    在failure: { (operation: AFHTTPRequestOperation!,

                    error: NSError!) in

                    println("Error: " + error.localizedDescription)          

            })这里 

    改为

    failure: { (operation: AFHTTPRequestOperation?,

                    error: NSError) in

                    println("Error: " + error.localizedDescription)          

            })


  • qq_戴着脚链奔跑_0
    2015-12-31 01:18:38

    请问解决了吗

  • 黑山白水
    2015-12-04 00:00:24

    我也遇到这个问题了

  • gdjy098
    2015-12-02 20:40:33

    manager.GET(url,

                parameters: params,

                success: { (operation: AFHTTPRequestOperation!,

                    responseObject: AnyObject!) in

                    println("JSON: " + responseObject.description!)

                    

                   

                },

                failure: { (operation: AFHTTPRequestOperation!,

                    error: NSError!) in

                    println("Error: " + error.localizedDescription)          

            })

    出问题的就是这段代码,谢谢

Swift Weather APP

本课程将带领大家使用Swift语言开发一个完整的天气 iOS APP

35555 学习 · 241 问题

查看课程