对成员 'tableView' 的引用不明确
Ambiguous reference to member 'tableView'
Code and errors
Continued on the code and one more errors!
嗨,我是 Xcode swift 的新手。到目前为止,除了尝试遵循 8.2 中的某人教程外,我一直做得很好,但我遇到了这些我最难理解的错误。任何人都可以解释这些错误的含义,也许,也许只是如何解决它们?
我已经编辑了我的帖子,不能 link 超过 2 个条目。
您需要在其他 @IBOutlet
之前声明您的 tableView
,因为您正在使用 UIViewController
并在其视图中放置 tableView
。目前 UIViewController
也不知道 tableView
你指的是什么。
@IBOutlet var tableView: UITableView!
然后 link 在界面生成器中将其添加到其他 @IBOutlet
中。确保你 link 你的 tableView
的 delegate
和 dataSource
属性也返回到视图控制器。
要执行后者,在您 select 您的 tableView
之后,select Connections Inspector 区域,如下图所示,并将它们连接回您的 UIViewController
.
就我而言,我使用了:
@IBOutlet private weak var tableView: UITableView!
并在扩展方法中使用 tableView。
我已将 private
更改为 fileprivate
,错误消失了。
这里是 Swift 4
let iPath = NSIndexPath(row: self.TableView.numberOfRows(inSection: 0)-1,
section: self.messageTableView.numberOfSections-1)
self.TableView.scrollToRow(at: iPath as IndexPath,
at: UITableViewScrollPosition.bottom,
animated: true)
Code and errors Continued on the code and one more errors!
嗨,我是 Xcode swift 的新手。到目前为止,除了尝试遵循 8.2 中的某人教程外,我一直做得很好,但我遇到了这些我最难理解的错误。任何人都可以解释这些错误的含义,也许,也许只是如何解决它们?
我已经编辑了我的帖子,不能 link 超过 2 个条目。
您需要在其他 @IBOutlet
之前声明您的 tableView
,因为您正在使用 UIViewController
并在其视图中放置 tableView
。目前 UIViewController
也不知道 tableView
你指的是什么。
@IBOutlet var tableView: UITableView!
然后 link 在界面生成器中将其添加到其他 @IBOutlet
中。确保你 link 你的 tableView
的 delegate
和 dataSource
属性也返回到视图控制器。
要执行后者,在您 select 您的 tableView
之后,select Connections Inspector 区域,如下图所示,并将它们连接回您的 UIViewController
.
就我而言,我使用了:
@IBOutlet private weak var tableView: UITableView!
并在扩展方法中使用 tableView。
我已将 private
更改为 fileprivate
,错误消失了。
这里是 Swift 4
let iPath = NSIndexPath(row: self.TableView.numberOfRows(inSection: 0)-1,
section: self.messageTableView.numberOfSections-1)
self.TableView.scrollToRow(at: iPath as IndexPath,
at: UITableViewScrollPosition.bottom,
animated: true)