为了账号安全,请及时绑定邮箱和手机立即绑定

函数的manager.GET报错

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

正在回答

6 回答

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

https://img1.sycdn.imooc.com//5be8e9230001cc2c10060684.jpg

0 回复 有任何疑惑可以回复我~

        manager.get(url,

                    parameters: params,

                    success: { (operation: AFHTTPRequestOperation,

                        responseObject: Any) in

                        var info = responseObject as? NSDictionary

                        print(info);

                        print("OK")

        },


0 回复 有任何疑惑可以回复我~

在failure: { (operation: AFHTTPRequestOperation!,

                error: NSError!) in

                println("Error: " + error.localizedDescription)          

        })这里 

改为

failure: { (operation: AFHTTPRequestOperation?,

                error: NSError) in

                println("Error: " + error.localizedDescription)          

        })


2 回复 有任何疑惑可以回复我~

请问解决了吗

0 回复 有任何疑惑可以回复我~

我也遇到这个问题了

0 回复 有任何疑惑可以回复我~

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)          

        })

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

1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Swift Weather APP
  • 参与学习       35565    人
  • 解答问题       241    个

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

进入课程

函数的manager.GET报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信