gpt4 book ai didi

swift - 获取输出帧失败,状态 8196

转载 作者:搜寻专家 更新时间:2023-10-31 22:38:18 25 4
gpt4 key购买 nike

当我尝试自定义 tableView 单元格时,我发现了这个错误。

"Get output frames failed, state 8196"

我只是不知道这是来自 Realm 还是来 self 的自定义 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 中它不起作用,因为它只向我显示此错误和表格 View 的整个空白页。

最佳答案

当您使用 Realm 时,即使您只打算离线使用它,也可以在控制台中打印此错误。

当应用程序在 Debug模式下运行时,它将匿名收集分析,如以下答案所述:Realm Swift use locally only, however it still tries to connect online

要停止错误,单击编辑方案,并添加环境变量 REALM_DISABLE_ANALYTICS,并将其设置为 YES,如下所示:

Environment variable screen

关于swift - 获取输出帧失败,状态 8196,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52710183/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com