guard let cell = tableView
.dequeueReusableCell(withIdentifier: cellIdentifier) as? FolderAndFileCell else {
print("some")
return
}
Run Code Online (Sandbox Code Playgroud)
它说
非空函数应该返回一个值
我应该回到这里做什么?
在里面cellForRowAt你必须
guard let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier) as? FolderAndFileCell else {
print("some")
return UITableViewCell()
}
Run Code Online (Sandbox Code Playgroud)
这个签名
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
应该有一个非 void 返回值
众所周知的方法是
let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier) as! FolderAndFileCell
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3951 次 |
| 最近记录: |