Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
session.dataTaskWithURL(NSURL(string: urlString)!, completionHandler: {
(taskData, taskResponse, taskError) -> Void in
var jsonReadError: NSError?
var jsonResult = NSJSONSerialization.JSONObjectWithData(taskData, options: NSJSONReadingOptions.MutableContainers, error: &jsonReadError) as NSDictionary
for (key, value) in jsonResult{
println("\(key) : \(value)")
}
let arr = jsonResult["SearchResults"] as NSArray
println("\(arr[0])")
println("\(arr[1])")
println("\(arr[2])")
println("\(arr[3])")
println("\(arr[4])")
let categ = arr[1]["CATEGORY"]
let searchval = arr[1]["SEARCHVAL"]
let xval = arr[1]["X"]
let yval = arr[1]["Y"]
println("\(jsonReadError)")
println("\(taskData)")
println("\(taskResponse)")
}).resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.