Shared publicly  - 
iOS Static Table View Cells Error in Storyboards: The Solution -

When you are working Storyboards in XCode 4.2 (or higher,) there is a great new feature that allows you to create static table view cells. What this means is that you can layout the contents of your cells right there in the storyboard and not have to go through the steps of generating those cells from a UITableViewDatasource.


In order to use static table view cells, your UITableView must be inside a UITableViewController. That's fine and dandy, but you may run into a problem if you set your base View Controller to a custom View Controller that inherits from UITableViewController. In such a scenario you will end up with an error in your build that says:

Illegal Configuration: Static table views are only valid when embedded in UITableViewController instances.

But, wait, didn't you just set your View Controller to a subclass of UITableViewController? Well, of course you did, but XCode doesn't seem to be smart enough to realize this. Try as you might to clean and re-clean and re-build your build, but you will never get rid of this error message.

The Fix:

It's simple really. You just have to let XCode know what it should have already figured out. Right-click your storyboard file and "Open As -> Source Code." Find the declaration for your View Controller, and you'll notice it is defined by an element that reads:

<viewController ...>

All you need to do is change that to:

<tableViewController ...>

Now, your project will build without a problem (assuming you've fixed all other problems in your build that is.) ;)
Rakesh Arora's profile photoRandika Chandrapala's profile photoFabrizio Bartolomucci's profile photoJelmer de Vries's profile photo
Thanks for the tip, this was very helpful. I did have to remove an intermediate UIView that somehow got between my table view and the controller, in case others are scratching their head.

I have a question though. I'm actually curious how Apple intends this to be used, since I can't understand putting a table view directly inside an instance of UITableViewController that isn't subclassed. Where would the logic for the screen go?
But for me after doing this, I couldn't open my storyboard anymore in IB!
It says,
"The document "Main.storyboard" could not be opened. Could not verify document content."
I've been spending around a day to fix this!
Because this project was happily running before, suddenly this has been happened! :(
My XCode version is 5.1
I have the same problem but my storyboard seems to list the item correctly:                
<tableViewController storyboardIdentifier="taxiDetail" useStoryboardIdentifierAsRestorationIdentifier="YES" id="FDn-rG-NnT" customClass="taxiDetail" sceneMemberID="viewController">
If I try to change the sceneNumberId it does not let me open the storyboard reporting an irregular configuration.
I tried this, but it didn't work for me. I still get the same error.
Add a comment...