Type 'ViewController' does not conform to protocol 'UITableViewDataSource'

后端 未结 17 2597
旧巷少年郎
旧巷少年郎 2020-11-29 03:02

Started practice swift. In singleViewController I am trying to make a UITableView. In storyboard I set the datasource and delegate. Here I am getting the error

17条回答
  •  孤城傲影
    2020-11-29 03:12

    This is probably caused by a typo or wrong styling on the method name. I used to cmd + left click on UITableView and copy & paste method names on my UIViewController; which won't work on Swift.

    Instead, type func tableView, look for the desired method on the list and let auto complete do its job.

提交回复
热议问题