【发布时间】:2018-10-08 21:12:41
【问题描述】:
当我尝试自定义一个 tableView 单元格时,我发现了这个错误。
“获取输出帧失败,状态 8196”
我只是不知道这是来自领域或来自我的自定义 tableView 单元格的错误。
class StudentTableViewController: UITableViewController {
let realm = try! Realm()
var student: Results<StudentName>?
var selectedClass: ClassName? {
didSet {
load()
}
}
var selected: String = ""
override func viewDidLoad() {
super.viewDidLoad()
navigationController?.title = selected
tableView.register(StudentTableViewCell.self, forCellReuseIdentifier: "studentName")
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return student?.count ?? 1
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "studentName", for: indexPath) as! StudentTableViewCell
cell.name.text = student?[indexPath.row].name ?? "There are no student in this class"
cell.number.text = "\(student?[indexPath.row].studentNumber ?? 0)"
return cell
}
func load() {
student = selectedClass?.studentNames.sorted(byKeyPath: "studentNumber", ascending: true)
tableView.reloadData()
}
}
我认为当我使用 Xcode 9 和 Swift 4.1 时它确实有效,但现在在 Xcode 10 中它不起作用,因为它只显示这个错误和表格视图的整个空白页。
【问题讨论】:
-
您在使用情节提要吗?哪一行代码抛出了这个错误?
-
是的tableview故事板
-
网络电话在哪里? “获取输出帧”指的是 BoringSSL 方法:
nw_protocol_boringssl_get_output_frames
标签: swift uitableview realm