[英]I cannot make a sample request with Alamofire
I just installed Alamofire 3.0 with swift 2.2 and xcode 7.3.1我刚刚用 swift 2.2 和 xcode 7.3.1 安装了 Alamofire 3.0
When I try to make the request as in the example at:当我尝试像示例中那样发出请求时:
https://github.com/Alamofire/Alamofire https://github.com/Alamofire/Alamofire
xcode says this: xcode 是这样说的:
I can not understand why我不明白为什么
You have your request outside a function.您在函数之外有您的请求。 Put it inside a
function
or in viewDidLoad
and it will work for you.把它放在一个
function
或viewDidLoad
,它会为你工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.