为什么“使用未声明的类型UITableView”发生在斯威夫特? [英] Why the "Use of undeclared type UITableView" happened in Swift?
问题描述
我是 Swift
的新手。我创建了第二个 swift文件
调用 DeviceInfo.swift
并添加 UIViewcontroller
in Main.storyboard
。
I am new to Swift
. I created a second swift file
call DeviceInfo.swift
and add a UIViewcontroller
in Main.storyboard
.
我还添加 UITableView
in UIViewcontroller(DeviceInfo)
。
但错误 在我将
c $ c>通过 UITableView
连接到 DeviceInfo.swift $后,使用未声明的类型'UITableView'
命令+左
。错误显示如下。
But the error Use of undeclared type 'UITableView'
show after I connect the UITableView
to DeviceInfo.swift
via command + left
. The error show like the following.
问题
1。为什么使用未声明的类型'UITableView'
发生了什么?如何解决?
1. Why the Use of undeclared type 'UITableView'
happened ? How to solve it ?
2。显示我将 dataSource
和委托
连接到 UIViewcontroller(DeviceInfo)
?
2. Show I connect the dataSource
and delegate
to UIViewcontroller(DeviceInfo)
?
提前致谢。
推荐答案
1. import UIKit
2.连接委托
和 dataSource
,
单击该点并拖动到tableView。
2.To connect delegate
and dataSource
,
click the point and drag to your tableView.
这篇关于为什么“使用未声明的类型UITableView”发生在斯威夫特?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!