无法在表格视图中的单元格中打印标签的值

时间:2017-12-07 10:02:40

标签: ios swift uitableview

我无法在单元格中以文本格式打印所需的值。仅打印第一个eventname值,而不是其字典的子字典中的其余值放在一个数组中。我的图像也有问题。后端的图像为空,然后它应该加载占位符以防万一。这是我写的代码。获取JSON时没有错误。我已经调试但我不认为JSON有错误:

func numberOfSections(in tableView: UITableView) -> Int {
    return 1
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return arrayNGOdetails.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let courseTitle = arrayNGOdetails[indexPath .row]

    let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCellEventMilesocdetails
    cell.milename.text = courseTitle.eventname
    cell.miledescription.text = courseTitle.studentclass
    cell.mileamount.text = courseTitle.studentfees
    return cell
}

0 个答案:

没有答案