不能下标值类型' [Int]'

时间:2015-10-29 17:24:42

标签: swift uitableview parse-platform

我正在尝试查询解析表中的数字并将其放在单元格中的标签内。但是当我尝试将解析中的值分配给单元格中标签中的值时,我收到的错误是无法下标值类型' [Int]'

这是代码:

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let singleCell: TableViewCell = tableView.dequeueReusableCellWithIdentifier("Cell") as! TableViewCell


    singleCell.Name.text = Label[indexPath.row]
    singleCell.entryNumber.text = runnerNumber[indexPath.row]


    return singleCell


}

我收到了错误的entryNumber代码行:无法下标值类型' [Int]' 我用谷歌搜索,但没有发现任何类似的情况 有什么建议? 我正在使用Parse作为我的后端,swift和Xcode 7

1 个答案:

答案 0 :(得分:0)

来自@russell

singleCell.entryNumber.text = "\(runnerNumber[indexPath.row])"