unable to dequeue a cell with identifier 🍎 iOS

unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard

The table/collection view was asked for a reusable cell identifier that was never registered.

Seen on: iOS

Meaning

The identifier must match the prototype cell’s Identifier in the storyboard or a register(_:forCellReuseIdentifier:) call — case-sensitive.

Common causes

  • Identifier typo or mismatch
  • Cell class/nib not registered for programmatic tables
  • Prototype cell identifier not set in storyboard

⚡ Quick fix

  1. Register the cell class/nib in viewDidLoad
  2. Set the identifier on the prototype cell
  3. Use a constant for the identifier

Detailed fix by platform

Swift

  1. swift
    tableView.register(UserCell.self, forCellReuseIdentifier: UserCell.reuseID)
    let cell = tableView.dequeueReusableCell(withIdentifier: UserCell.reuseID, for: indexPath) as! UserCell

How to diagnose

  1. Identifier — Same string everywhere?
  2. Registration — Called before reload?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.