我是 Swift
的新手。我创建了第二个 swift 文件
调用 DeviceInfo.swift
并在 Main.storyboard
中添加了一个 UIViewcontroller
。
我还在 UIViewcontroller(DeviceInfo)
中添加了一个 UITableView
。
但是错误 Use of undeclared type 'UITableView'
在我将 UITableView
连接到 DeviceInfo.swift
后显示> 通过 command + left
。错误显示如下。
问题
<强>1。为什么 Use of undeclared type 'UITableView'
发生了?如何解决?
<强>2。显示我将 dataSource
和 delegate
连接到 UIViewcontroller(DeviceInfo)
?
提前致谢。
最佳答案
1.导入 UIKit
2.连接delegate
和dataSource
,
单击该点并拖动到您的 tableView。
关于ios - 为什么 "Use of undeclared type UITableView"发生在 Swift 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28017622/