import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL(string: "http://www.kinodrive.com/some_test/jsontest.php")
var request = NSURLRequest(URL: url!)
var data = NSURLConnection.sendSynchronousRequest(request, returningResponse: nil, error: nil)
if data != nil {
var hoge = JSON(data: data!)
println(hoge)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
我收到的数据,但不是因为无法找到如何使用它们的示例,总是有错误。
如何将它们变成数组或字典,欢迎参考,示例!