-1
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.
    }
}

The data I received, but not as it is impossible to find an example of how to use them, always have mistakes.

How To turn them into an array or a dictionary, reference, examples are welcome!

pnuts
  • 58,317
  • 11
  • 87
  • 139
  • what language is it ? swift ? if so, adding a tag would make it easier for relevant people to find your question. – Alp Jun 30 '15 at 18:31
  • Your question is unclear. What issue are you having with the code you posted? What does the JSON look like? What exact format are you trying to convert it into? – rmaddy Jun 30 '15 at 18:40
  • I want to use the data in the application for type tableview. The application will be the latest movies, it is necessary that the data is loaded into the desired Cell, the title - the title, the text - text, photos - photos and so on. Thank you for your comment on the account of tags will be the next time please ... – Виталий Иванов Jun 30 '15 at 18:51

1 Answers1

0

No need to use external libraries; the iOS JSON parser is very good at providing both Dictionaries and Arrays from JSON. Here's a good tutorial: http://www.appcoda.com/fetch-parse-json-ios-programming-tutorial/

Joshua Jackson
  • 348
  • 2
  • 11