Reputation: 13115
I've made this mistake several times so I thought I'd share the solution. It often happens while I'm converting a mocked up iOS app to a real app. While I'm mocking up I use the storyboard in Xcode without assigning sublcasses to the UIViewControllers. But then when I'm happy with the design I go in to write the code and after I create the subclasses and assign them to the storyboard screens.
A common problem I encounter is my UITableViewController screens have their static content disappear when I assign the subclass.
Steps to reproduce problem:
At this point when I run the project in the simulator the screen's static content has disappeared.
Upvotes: 0
Views: 128
Reputation: 13115
This is the missing step from the sequence above.
Code to remove:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 0;
}
You'll need to keep this code out until you need to change the content from Static Cells to Dynamic Cells.
Upvotes: 1