我在
IOS9 xcode项目中的.playground文件中出现此错误消息:
我所做的是:
>开始了Xcode 7 / Swift 2项目
>使用“pod install Alamofire”
>使用以下代码创建.playground文件:
进口Alamofire
- Alamofire.request(.GET,"http://httpbin.org/get",parameters: ["foo": "bar"]).responseJSON { response in
- print(response.request) // original URL request
- print(response.response) // URL response
- print(response.data) // server data
- print(response.result) // result of response serialization
- let str = response.data!
- if let JSON = response.result.value {
- print("JSON: \(JSON)")
- }
- }
如何在.playground文件中测试此库而不会出错?
根据业主的说法,从版本3开始,游乐场支持似乎已被删除:
We removed the playground in the latest versions of Alamofire. Caused more problems than it was worth.
资料来源:https://github.com/Alamofire/Alamofire/issues/368#issuecomment-158789746
不幸的是,要启用游乐场支持,您必须降级Alamofire.