gpt4 book ai didi

swift - 将类 "hides"的 UITableView 设置为 outlets 的 outlet 部分

转载 作者:行者123 更新时间:2023-11-28 08:36:46 27 4
gpt4 key购买 nike

我创建了 UITableViewController 的子类,然后将其设置为 UIStoryboard 中的 View 。

问题是启动应用程序时屏幕变黑,我认为这可能是因为 View 的 View outlet 设置不正确。通过将此 View 与其他 View 进行比较,我发现网点有所不同:我没有网点的“网点”部分,因此无法连接“ View ”和表网点。

从 View 中删除类将显示那些 socket (处于未连接状态)。

这是怎么回事?

  • 没有类集的网点:

enter image description here

  • 类集网点:

enter image description here

最佳答案

如果您的导出选项卡从您的连接器检查器中消失,则身份检查器中发生了一些事情:

enter image description here

你在哪里更改了appartenence的类字段。

事实上,它们是直接连接的,因此类类型的任何更改都会反射(reflect)属于该类的 IBOutlets 代码,并且连接器检查器将使用该类中存在的 IBOutlets 列表进行更新。

正如下面评论中所解释的,您必须像下图那样选择“黄色按钮”:

enter image description here

指定要链接的类,我例子中黄色行Preload View Controller下方的其他声音是类内部的对象,如View等。

更新:在您在评论中报告的链接 ( https://github.com/luinily/hOme/blob/VIP-Object-Creator/hOme/Scenes/Devices/DevicesViewController.swift ) 中没有 IBOutlets,所以您在connectors inspector

中从未看到它是正确的

关于swift - 将类 "hides"的 UITableView 设置为 outlets 的 outlet 部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37528196/

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