When I try to customise a tableView cell, I found this error.
"Get output frames failed, state 8196"
I just have no idea it is the error from realm or from my customise tableView cell.
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()
}
}
I think it did work when I am using Xcode 9 and Swift 4.1 but now in Xcode 10 it doesn't since it only show me this error and whole blank page of table view.