Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
734 views
in Technique[技术] by (71.8m points)

swift - Ambiguous reference to member 'tableView'

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...