Xcode 说“候选者的 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 {
and
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)