为什么“使用未声明的类型UITableView”发生在斯威夫特? [英] Why the "Use of undeclared type UITableView" happened in Swift?

查看:181
本文介绍了为什么“使用未声明的类型UITableView”发生在斯威夫特?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 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)

但错误 在我将 UITableView 连接到 DeviceInfo.swift c $ c>通过命令+左。错误显示如下。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆