Ios 函数错误中缺少返回-Swift Xcode
我对斯威夫特非常陌生,这个错误不断出现 它表示预期在UITableViewCell中返回的函数中缺少返回 代码:Ios 函数错误中缺少返回-Swift Xcode,ios,swift,Ios,Swift,我对斯威夫特非常陌生,这个错误不断出现 它表示预期在UITableViewCell中返回的函数中缺少返回 代码: 任何帮助。。。非常感谢您需要声明一个单元格。标识符是您在故事板中添加的标识符,我的在本例中称为“单元” let cell: UITableViewCell! = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) 例如,设置单元格属性 cell.textLabel.text =
任何帮助。。。非常感谢您需要声明一个单元格。标识符是您在故事板中添加的标识符,我的在本例中称为“单元”
let cell: UITableViewCell! = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
例如,设置单元格属性
cell.textLabel.text = "Test"
然后把手机还给我
return cell
此方法返回给定路径上的单元格,因此这是为该单元格添加信息的部分。阅读并熟悉UITableView类
func tableView(tableView: UITableView,cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
let cell: UITableViewCell! = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
cell.textLabel.text = "Test
return cell
}
我仍然困惑,请帮助…检查更新的文本。不要添加代码的图像,复制/粘贴到问题中。然后选择工具栏{}上的代码和chicl,使其显示为代码。