Storyboard warning: prototype table cells must have reuse identifiers

IphoneIosXcodeStoryboard

Iphone Problem Overview


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?

Iphone Solutions


Solution 1 - Iphone

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

enter image description here

Solution 2 - Iphone

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 - Iphone

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 - Iphone

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 - Iphone

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).

Solution 6 - Iphone

A hail mary: restarting XCode worked for me (but it was probably just a manual rebuild that was required).

Solution 7 - Iphone

I got this warning for Xcode 7. I am working with Swift. I did not added the navigation controller for the initial view controller. When I did so.. I got this warning from StoryBoard. What I did is:

  1. There are two segues
  2. from Navigation Controller to Root view Controller and
  3. from Root View controller to your initial View controller.
  4. Select the segue connecting the root view controller to the initial view controller.
  5. Name the identifier
  6. Select the "Prototype" written part of the controller--> there you will see identifier as an option.
  7. Paste the same name of the identifier as entered earlier.

The warning goes.. if not clean the sdk :)

Solution 8 - Iphone

Be sure that you are setting the Reuse Identifier on the object, rather than the Restoration ID. Both are available via the storyboard, and easily confused.

In the storyboard XML file you'll want to be setting reuseIdentifier, not restorationIdentifier.

Solution 9 - Iphone

I've noticed that this error occurs when you have multiple prototype cells (in the tableview properties) and have not given all of them re-use identifiers.

Solution 10 - Iphone

The identifier is the name you refer to in you .m file. When it is not filled it is not possible to reference the cell.

Solution 11 - Iphone

This for setting reuse identifier by programmatically

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath (NSIndexPath*)indexPath 
{
    static NSString *cellIdentifier = @"wot";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];

    if (!cell)
        cell = [[UITableViewCell alloc] initWithStyle: someStyle reuseIdentifier: cellIdentifier];

    return cell;
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionK.HondaView Question on Stackoverflow
Solution 1 - IphonealerootView Answer on Stackoverflow
Solution 2 - IphonebitsandView Answer on Stackoverflow
Solution 3 - IphoneDmitry VaravkinView Answer on Stackoverflow
Solution 4 - IphoneMarcel WassmerView Answer on Stackoverflow
Solution 5 - IphoneSitricView Answer on Stackoverflow
Solution 6 - IphoneHanneleView Answer on Stackoverflow
Solution 7 - IphoneLovina HajirawalaView Answer on Stackoverflow
Solution 8 - IphonepkambView Answer on Stackoverflow
Solution 9 - IphoneTjalsmaView Answer on Stackoverflow
Solution 10 - IphoneVincentView Answer on Stackoverflow
Solution 11 - IphoneMukesh LokareView Answer on Stackoverflow