Storyboard warning: prototype table cells must have reuse identifiers

80,636

Solution 1

To shut up the warning you have to give a name to the cell identifier :

enter image description here

Solution 2

Another way is to set the Table View 'Prototype Cells' property to zero in Attributes Inspector, if you are defining the cell using a .xib programatically.

Setting prototype cells to 0 in Attributes Inspector

Solution 3

As storyboard is actually XML file, so another trick is to open your storyboard with any text editor (not Xcode!) and try to find all tableViewCell nodes. For example press CMD+F, type <tableViewCell contentMode="scaleToFill" and press Enter. You will probably find out, the rows same to this one:

<tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="GenericCellID" id="kBr-Qn-Tki">

Please pay your attention on reuseIdentifier="GenericCellID" key value. The rows which fire the warning (without reuse identifiers) will not have such key value. Look nodes above in your text editor and you will see tableViewController node with class name you need to check in Xcode's storyboard editor and fix, according to aleroot' answer.

Solution 4

If your Xcode warning still doesn't go away even after you have set the reuseIdentifier, then try Menu "Product -> Clean". This helped for me and after that, the warning didn't show up anymore.

Solution 5

Since double-clicking this warning can lead to a bit of a wild goose chase (the specific UITableViewCell doesn't get selected), just wanted to add that while some of these warnings will auto-resolve, some will not.

If you are confident you've tagged all your cells in Storyboard, rebuild the project - your warning may disappear (as did mine).

Share:
80,636
K.Honda
Author by

K.Honda

Updated on October 30, 2020

Comments

  • K.Honda
    K.Honda over 3 years

    I am getting this warning from storyboard - prototype table cells must have reuse identifiers.

    I have renamed the identifier in the attributes inspector but it does not seem to have removed the warning.

    Any suggestions?

  • Idan Magled
    Idan Magled about 10 years
    happned to me to. close xcode - open it, and then change the identifier
  • saimonx
    saimonx almost 10 years
    When the warning remains means that somewhere in your StoryBoard there is still a cell without identifier
  • CatsLoveJazz
    CatsLoveJazz over 9 years
    I've seen this too, is there a way to name all the cells at once or is there another way to remove these warnings?
  • Vincent
    Vincent over 9 years
    Every Prototye cell needs it own unique name. So there is no way to do it automatically
  • Lars Christoffersen
    Lars Christoffersen over 9 years
    If you have more than 1 prototype cells, you must give them all an indetifier, else just set the number to one in the prototype cell
  • Michael McGuire
    Michael McGuire about 9 years
    I had to delete the Derived Data folder (Xcode equivalent of a Windows Reboot) and rebuild to get rid of this spurious warning.
  • NSTJ
    NSTJ almost 8 years
    You can actually open your storyboard as code with Xcode by doing a CTRL+click on your storyboard file > Open As > Source Code
  • dldnh
    dldnh about 7 years
    This worked for me: close Xcode, open /Users/username/Library/Developer/Xcode/DerivedData in Finder, and delete all of its contents (not the DerivedData folder itself).