4

I have create a scene using the story board that contains a single, grouped table view. The cells for this table are static (this is a configuration view). I created all the table cells from within the storyboard editor The view is assigned a custom view controller which inherits from the UITableViewController. If set this as the 'initial view controller' for testing purposes the application crashes. The error is:

illegal configuration - Static table view are only valid when embedded in UITableViewController

In the view controller for this view i have implemented both tableView:numberOfRowsInSection & numberOfSectionsInTableView

Can someone tell me how to make static tableviews work with storyboards?

Thanks!

Nick
  • 19,198
  • 51
  • 185
  • 312

1 Answers1

1

By default when Xcode creates a subclass of UITableViewController it adds UITableView datasource delegate methods. Since a static TableView does need a datasource these NEED to be removed.

So the solution was to remove these delegate methods:

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView


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


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Nick
  • 19,198
  • 51
  • 185
  • 312
  • 1
    I have tried this and [link](http://stackoverflow.com/questions/9277473/want-to-create-a-cool-static-ui-but-static-table-views-are-only-valid) together and apart but no joy. Seems you can not have static table in a normal view (why I do not know). – Recycled Steel Jun 25 '13 at 09:41