ios - UITableView 没有名为 count 的成员

标签 ios uitableview swift

我是 Swift 语言的新开发人员,所以我正在尝试使用静态数组制作简单的 UITableview,但效果不佳。 我收到此错误消息说 UITableview 没有任何名为 count 的成员。 我能做些什么来解决这个问题? 先感谢您 The Wrror

最佳答案

你必须传递你的 array 计数而不是 tableView 计数

numberOfRowInSection

返回 self.myArray.count

cellForRowAtIndexPath

cell.textLabel.text = self.myArray[indexPath.row]

关于ios - UITableView 没有名为 count 的成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30681467/

相关文章:

ios - Protobuf数据在swift中反序列化错误

ios - restkit 版本 0.20 上的 fetchRequest - 没有已知的类方法

ios - 第一个单元格 UItableViewController 问题 Swift

iPhone :How to get duration of video selected from library?

ios - 如何在 Storyboard 中的自定义 UITableViewCell 中配置 UITableView?

ios - Storyboard中的 UITableView 标题高度不会改变

具有相同名称的 Swift 枚举案例

ios - CoreBluetooth 检测外设

ios - 具有自动布局的UITableView中的动态列

ios - 无法删除索引路径中的行