Ambiguous reference to member 'tableView'
Asked Answered
F

3

11

Code and errors Continued on the code and one more errors!

Hi, I'm new to Xcode swift. I have been doing good so far except trying to follow someone tutorial from 8.2 and I'm getting these errors that I have the hardest time understanding. Anybody who can explain what these errors means and maybe, just maybe how to fix them?

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

Fenella answered 15/11, 2015 at 19:46 Comment(0)
V
15

You need to declare your tableView up by your other @IBOutlets since you are using a UIViewController and putting a tableView within it's view. Currently the UIViewController doesn't know what tableView you are referring too.

@IBOutlet var tableView: UITableView!

Then link it up in the interface builder as you have done with your other @IBOutlets. Make sure you link the delegate and dataSource properties of your tableView back to the view controller as well.

To do the latter, after you select your tableView, select the Connections Inspector area, as shown in the picture below, and connect them back to your UIViewController.

enter image description here

Viquelia answered 15/11, 2015 at 19:54 Comment(2)
Post updates in the comments here instead. Yeah seems like you have done it. Did you also connect your @IBOutlet reference to the tableView?Viquelia
Yeah, I have done it, thanks a lot for the help! I need to keep my eyes open on the small stuff! =)Fenella
F
2

In my case, I've used:

@IBOutlet private weak var tableView: UITableView!

and use tableView inside extensions method.

I've change private to fileprivate, and error has gone.

Finkle answered 5/10, 2017 at 6:54 Comment(0)
E
1

Here it 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)
Egger answered 22/10, 2017 at 19:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.