0

enter image description here

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

            if indexPath.row == 1
            {
                let cell = Bundle.main.loadNibNamed("KonuDetayKonuTableViewCell", owner: self, options: nil)?.first as! KonuDetayKonuTableViewCell
                cell.lblBaslik.text = arrayYorumData[indexPath.row].baslik
                cell.lblKullaniciAdiVeTarih.text = arrayYorumData[indexPath.row].uye + " - " + arrayYorumData[indexPath.row].tarih
                cell.lblYazi.text = arrayYorumData[indexPath.row].yazi
                cell.updateConstraintsIfNeeded()
                if singleton.username != arrayYorumData[indexPath.row].uye{
                    cell.btnDüzenle.isHidden = true
                }

                return cell
            }

        }

Hi I'm getting an error here. How can I solve the problem? I did not have a problem with the previous version but I started getting this error in the version I just updated

user7337400
  • 153
  • 1
  • 1
  • 4

1 Answers1

1

you're only returning when indexPath.row is = 1, take care of any value.

you could solve this by adding this to the end of the function:

return UITableViewCell()

but generally you'll want to dequeue a reusable cell from your table view, and set up the cells how you want them

Gaston Gonzalez
  • 427
  • 3
  • 6