Storyboard warning: prototype table cells must have reuse identifiers
Solution 1
To shut up the warning you have to give a name to the cell identifier :
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.
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).
K.Honda
Updated on October 30, 2020Comments
-
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 about 10 yearshappned to me to. close xcode - open it, and then change the identifier
-
saimonx almost 10 yearsWhen the warning remains means that somewhere in your StoryBoard there is still a cell without identifier
-
CatsLoveJazz over 9 yearsI'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 over 9 yearsEvery Prototye cell needs it own unique name. So there is no way to do it automatically
-
Lars Christoffersen over 9 yearsIf 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 about 9 yearsI had to delete the Derived Data folder (Xcode equivalent of a Windows Reboot) and rebuild to get rid of this spurious warning.
-
NSTJ almost 8 yearsYou can actually open your storyboard as code with Xcode by doing a CTRL+click on your storyboard file >
Open As
>Source Code
-
dldnh about 7 yearsThis 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).