Xcode 说“Candidate 的 UITableView 类型不匹配......”有人知道如何解决这个问题吗?
func tableView(tableView: UITableView?, numberOfRowsInSection section: Int)
-> Int {
return dataSource[section].count
}
func tableView(tableView: UITableView?, cellForRowAtIndexPath indexPath: NSIndexPath!)
-> UITableViewCell? {
let cell = tableView!.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell
if let path = indexPath{
let currentString = dataSource[path.section][path.row]
cell.textLabel?.text = currentString
}
return cell
}
最佳答案
函数签名已更改。您需要更新到这些:
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
和
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
关于ios - 候选人有不匹配的类型 UITableView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25801714/