Tag: indexpath

Swift超出范围…与tableView

我遇到了超出range错误… 错误发生在cell.creditLabel.text = numOfDays[(indexPath as NSIndexPath).row] + "days" 。 如果我把cell.nameLabel.text = nameArray[(indexPath as NSIndexPath).row] tableView.reloadData()后面的cell.nameLabel.text = nameArray[(indexPath as NSIndexPath).row] 那么在模拟器中什么也没有显示 我怎样才能解决这个问题..? func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.nameArray.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell : MoneyTableViewCell = tableView.dequeueReusableCell(withIdentifier: "MoneyTableViewCell", for: indexPath) as! MoneyTableViewCell […]