我一直在从YouTube上的教程学习表视图。我一直在跟踪视频中讲述的每一个步骤,并且做了与本教程作者相同的所有内容,但出于某种原因,我得到了一个奇怪的错误 - 我听说它是关于本教程中使用的旧版Xcode - 米工作在最新的一个。Xcode(Swift)错误 - 使用未声明类型'CustomCell'
调试器告诉“CustomCell”未声明。
每一个帮助将不胜感激!
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return arrayOfCwiczenia.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: CustomCell = tableView.dequeueReusableCellWithIdentifier("Cell") as CustomCell
let person = arrayOfCwiczenia[indexPath.row]
cell.setCell(cwiczenia.nazwa, imageName: cwiczenia.obrazek)
return cell
}
你有没有试过用shift +命令+ K清理然后再试一次? – Ammo