Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom UITableViewController doesn't load static cells

Tags:

cocoa

I was experimenting with static cells, therefore I made a Table View and embedded a UITableViewController in it and then added some static cells. Everything worked fine until I made a new UITableViewController class and connected it as a custom class thorugh the interface builder. Since then, when I build the App, it just shows an empty Tableview without any cells in it and now I'm wondering what I'm missing.

I tried some researching, I doubt I'll be the first one to ask, but evidently I must have been looking for the wrong thing. I guess there must be something that goes to ViewDidLoad, so the static cells get loaded?

like image 448
Hans Avatar asked Jul 30 '12 08:07

Hans


1 Answers

Here is the solution:

Remove the following methods from the .m file:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
} 
like image 60
Hans Avatar answered Oct 15 '22 02:10

Hans