Ambiguous reference to tableView element '

Code and errors Continuation of the code and one more error!

Hi, I am new to Xcode swift. I still do it well, except trying to follow something with tutorial 8.2, and I get these errors, which are the hardest for me to understand. Anyone who can explain what these errors mean and maybe maybe how to fix them?

I edited my posts, can't link more items than 2.

+7
swift tableview
source share
3 answers

You need to declare your tableView different with your @IBOutlet , since you use the UIViewController and put the tableView in its view. Currently, the UIViewController does not know which tableView you are accessing either.

@IBOutlet var tableView: UITableView!

Then link it in the interface builder, as was done with other @IBOutlet s. Make sure you link the delegate and dataSource your tableView back to the view controller.

To do this, after selecting the tableView , select the "Connection Inspectors" area, as shown in the figure below, and return them to the UIViewController .

enter image description here

+8
source share

In my case, I used:

 @IBOutlet private weak var tableView: UITableView! 

and use the tableView method inside the extensions.

I changed private to fileprivate and the error fileprivate away.

0
source share

Here he is in 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) 
0
source share

All Articles