1
我有问题,此代码 -错误 - 线程1个exc_bad_instruction(代码= exc_1386_invop子码=为0x0)
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func get(){
let url = NSURL(string: "http://www..php")
let data = NSData(contentsOfURL: url!)
values = try! NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers) as!NSArray
tableView.reloadData()
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return values.count;
}
此错误 线程1个exc_bad_instruction(代码= exc_1386_invop子码=为0x0)
你可以分享你的数据,以便更好地理解。 –
@Anupam米什拉 - FUNC得到(){ 设URL = NSURL(字符串: “HTTP://www..php”) 让数据= NSData的: 值=尝试(contentsOfURL网址!)! NSJSONSerialization.JSONObjectWithData(数据!选项:NSJSONReadingOptions.MutableContainers)作为NSArray的 tableView.reloadData() } FUNC的tableView(的tableView:UITableView的,numberOfRowsInSection部的:int) - >内部{ 返回values.count; } – hamid
请在原始文章中添加您的代码并将其格式化(cmd + k)。 – jbehrens94