Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 - Static Table View doesn't appear on simulator

I am using storyboard. Although the static table view appears inside the storyboard, after running on simulator it doesn't appear. To be more accurate only the section header appears. If I change the style to dynamic, the table view appears!

like image 741
Abdalrahman Shatou Avatar asked Oct 07 '13 23:10

Abdalrahman Shatou


1 Answers

There probably 2 possible causes.

First, you're not using a UITableViewController in the storyboard, i.e. you have a UITableView inside of a UIViewController. I'm pretty sure you must use a UITableViewController if you want to use static cells.

Second, you have correctly instantiated the UITableView but you've implemented the programmatic control functions in the UITableView's delegate. To be specific these functions include at least:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

If neither is the case then I think you need to provide more information.

like image 62
Mike S Avatar answered Oct 21 '22 01:10

Mike S