Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 函数错误中缺少返回-Swift Xcode_Ios_Swift - Fatal编程技术网

Ios 函数错误中缺少返回-Swift Xcode

Ios 函数错误中缺少返回-Swift Xcode,ios,swift,Ios,Swift,我对斯威夫特非常陌生,这个错误不断出现 它表示预期在UITableViewCell中返回的函数中缺少返回 代码: 任何帮助。。。非常感谢您需要声明一个单元格。标识符是您在故事板中添加的标识符,我的在本例中称为“单元” let cell: UITableViewCell! = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) 例如,设置单元格属性 cell.textLabel.text =

我对斯威夫特非常陌生,这个错误不断出现

它表示预期在UITableViewCell中返回的函数中缺少返回

代码:


任何帮助。。。非常感谢

您需要声明一个单元格。标识符是您在故事板中添加的标识符,我的在本例中称为“单元”

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,使其显示为代码。