我收到錯誤崩潰沒有在互聯網上沒有連接時,這條線上網
fatal error: unexpectedly found nil while unwrapping an Optional value
。
let jsonData = try NSJSONSerialization.JSONObjectWithData(data!, options: .MutableContainers) as! NSDictionary // Line
self.dict = jsonData;
self.array1 = (self.dict.objectForKey("results") as? NSMutableArray)!
dispatch_async(dispatch_get_main_queue()) {
self.table.reloadData()
}
} catch {
print(error)
}
})
task1.resume()
請幫助任何幫助將apperciated
可能重複的[斯威夫特2的iOS 9做抓住嘗試崩潰與意外的零發現](http://stackoverflow.com/questions/32187683/swift-2-ios-9-do-catch-try-crashing-with-unexpected-nil-found) – Moritz