详细信息(字幕)文本不会出现.不过,这些数据是可用的,因为当添加println()调用时,它会将可选("数据")打印到控制台,其中包含预期的数据.在情节提要中,UITableViewController设置为正确的类,表视图单元格样式设置为"Subtitle",重用标识符设置为"Cell".如何获取要显示的字幕信息?
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell
dispatch_async(dispatch_get_main_queue(), { () -> Void in
cell.textLabel.text = self.myArray[indexPath.row]["title"] as? String
cell.detailTextLabel?.text = self.myArray[indexPath.row]["subtitle"] as? String
println(self.myArray[indexPath.row]["subtitle"] as? String)
// The expected data appear in the console, but not in the iOS simulator's table view cell.
})
return cell
}