gpt4 book ai didi

ios - 为什么 "Use of undeclared type UITableView"发生在 Swift 中?

转载 作者:IT王子 更新时间:2023-10-29 05:14:08 24 4
gpt4 key购买 nike

我是 Swift 的新手。我创建了第二个 swift 文件 调用 DeviceInfo.swift 并在 Main.storyboard 中添加了一个 UIViewcontroller

我还在 UIViewcontroller(DeviceInfo) 中添加了一个 UITableView

但是错误 Use of undeclared type 'UITableView' 在我将 UITableView 连接到 DeviceInfo.swift 后显示> 通过 command + left。错误显示如下。 enter image description here

问题

<强>1。为什么 Use of undeclared type 'UITableView' 发生了?如何解决?

<强>2。显示我将 dataSourcedelegate 连接到 UIViewcontroller(DeviceInfo)

提前致谢。

最佳答案

1.导入 UIKit

2.连接delegatedataSource,单击该点并拖动到您的 tableView。 enter image description here

关于ios - 为什么 "Use of undeclared type UITableView"发生在 Swift 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28017622/

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