Xcode: When I load my app onto a simulator or device, nothing is appearing in the tableViewCells

Viewed 51

Here is what I see on the storyboard. You can see the attributes of my table on the right:

enter image description here

Here is what I'm seeing after I launch the app:

enter image description here

I have not written any code that changes the view. It's all here in the storyboard. Everything is visible except the cells.

1 Answers

Xcode actually let you compile and run app with a tableview inside a UIViewController but It will show a blank table .. So instead of UIViewController embed static cell in UITableViewController . You can use ContainerView to get a static UITableView along with other controls on the same screen .. Embed tableViewController in containerView

Ray Wenderlich's website Blog Post says

One more thing about static cells, they only work in UITableViewController. The Storyboard Editor will let you add them to a Table View object inside a regular UIViewController, but this won’t work during runtime. The reason for this is that UITableViewController provides some extra magic to take care of the data source for the static cells. Xcode even prevents you from compiling such a project with the error message: “Illegal Configuration: Static table views are only valid when embedded in UITableViewController instances”.

.

Related