let url = NSURL(string: "http://msyk.net")
let config = NSURLSessionConfiguration.ephemeralSessionConfiguration()
let session = NSURLSession(configuration: config)
let task = session.dataTaskWithURL(url!, completionHandler: {
(data: NSData!, response: NSURLResponse!, error: NSError!) -> Void in
let dataString = NSString(data: data, encoding: NSUTF8StringEncoding)
// setup the model with dataString.
session.finishTasksAndInvalidate()
let mainQueue = NSOperationQueue.mainQueue()
mainQueue.addOperationWithBlock({
tableView.reloadData()
})
})
task.resume()