Ambiguous reference to member 'tableView'
You need to declare your tableView
up by your other @IBOutlet
s 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 @IBOutlet
s. 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
.
Ambiguous reference to member 'tableView(_:didSelectRowAt:)' (Swift)
You are missing the @IBOutlet
for your tableView
. So when you reference self.tableView
Swift thinks you are talking about one of the methods that starts with tableView
.
So, get rid of this line in searchBar(_:textDidChange:)
:
let tableView = UITableView()
and add an outlet to your tableView
and connect it:
@IBOutlet weak var tableView: UITableView!
Ambiguous reference to member 'tableView(_:numberOfRowsInSection:)'
The problem is that there is nothing in your view controller called self.tableView
. Its name is completedCaseTableView
. So change this:
if let indexPath = self.tableView.indexPathForSelectedRow {
to this:
if let indexPath = self.completedCaseTableView.indexPathForSelectedRow {
Ambiguous reference to member 'tableView(_:numberOfRowsInSection:)' Why this error?
It's not finding tableView
, and is therefore getting thrown off, assuming you somehow meant to reference this method (which you don't, obviously).
Note, your outlet is tableview
, not tableView
. Properties are case sensitive.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "show Detail" {
if let indexPath = self.tableview.indexPathForSelectedRow {
let taakDetail : Taak = taken[indexPath.row]
let controller = (segue.destination as! UINavigationController).topViewController as! DetailsViewController
controller.selectedTaak = taakDetail
}
}
}
Ambiguous reference to member 'tableView' when dequeuing a cell
Try changing the line to
let cell = tableView.dequeueReusableCellWithIdentifier("FeedCell", forIndexPath: indexPath) as! FeedCell
Just remove the ! from FeedCell!
and put it in as!
and check if there is any difference.
Beside as @redent84 mentioned in his comment you should use tableView
instead of self.tableView
.
Ambiguous reference to member 'tableView' using RxSwift
Found the issue. DefaultReuseIdentifier wasn't defined in the MovieListCell. :)
Funny error message though!
tableView.reloadData() error: Ambiguous reference to member
You don't have an outlet called tableView
. Create one, connect it to Interface Builder and you should be fine.
Related Topics
How to Determine the Type of a Variable in Swift
Uicollectionview - Resizing Cells on Device Rotate - Swift
Dispatchsourcetimer and Swift 3.0
Upvote/Downvote System Within Swift via Firebase
Override Func Error in Swift 2
Building Pure Swift Cocoa Touch Framework
Swift - Unit Testing Private Variables and Methods
A Swift Protocol Requirement That Can Only Be Satisfied by Using a Final Class
Generating Resource_Bundle_Accessor, Type 'Bundle' Has No Member 'Module'
How to Include .Swift File from Other .Swift File in an Immediate Mode
Swift Generics: Requiring Addition and Multiplication Abilities of a Type
Swift: Determine What Object Called a Function
How to Replicate Promisekit-Style Chained Async Flow Using Combine + Swift
How to Draw Text in PDF Context in Swift
Draw on a PDF Using Swift on MACos