swift2 – Playground Xcode:无法获得沙箱扩展

前端之家收集整理的这篇文章主要介绍了swift2 – Playground Xcode:无法获得沙箱扩展前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在 IOS9 xcode项目中的.playground文件中出现此错误消息:
  1. 2015-10-28 16:28:45.159 Playground[83944:17501939] Failed to obtain sandBox extension for path=/var/folders/h7/cbc1x51x2rs7sjzfk0ndtxkr0000gp/T/com.apple.dt.Xcode.pg/containers/

我所做的是:

>开始了Xcode 7 / Swift 2项目
>使用“pod install Alamofire”
>使用以下代码创建.playground文件

进口Alamofire

  1. Alamofire.request(.GET,"http://httpbin.org/get",parameters: ["foo": "bar"]).responseJSON { response in
  2.  
  3. print(response.request) // original URL request
  4. print(response.response) // URL response
  5. print(response.data) // server data
  6. print(response.result) // result of response serialization
  7.  
  8. let str = response.data!
  9.  
  10. if let JSON = response.result.value {
  11. print("JSON: \(JSON)")
  12. }
  13. }

如何在.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.

猜你在找的Swift相关文章