gpt4 book ai didi

ios - swift/ios 如何检查我的 TableView 是否嵌入在 uitableview Controller 实例中?

转载 作者:行者123 更新时间:2023-11-29 01:40:35 24 4
gpt4 key购买 nike

获取消息:

static table views are only valid when embedded in uitableview controller instances

但是在我的 ViewController 中,它是我的 tableview 的数据源

import UIKit

class ViewController: UITableViewController {

override func viewDidLoad() {

super.viewDidLoad()

}

}

我已经清理了该项目并再次运行它,但没有任何运气。

最佳答案

您的用户界面必须在静态表格的 Storyboard中设置。此外,Storyboard 中使用的对象必须是 UITableViewController。您可以在身份检查器(第三个,您可以在其中设置自定义类)中验证这一点。如果您暂时清除自定义类,默认值应该是 UITableViewController。如果不是,您应该拖过一个 Table View Controller 并将您的 View 移动到使用它。

关于ios - swift/ios 如何检查我的 TableView 是否嵌入在 uitableview Controller 实例中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32438883/

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