I\'m aware of the problem that one is not able to have static table view content in a UIViewController in
I don\'t get a warning/error but he also doesn\'t compile. Is
There's a way to improve Can's answer.
Connect your cells to code not as IBOutlet
but as IBOutletCollection
. If you name it as e.g. cells your code will look like this, which makes it slightly cleaner:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.cells.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
return self.cells[indexPath.row];
}
The order in which you connect cells to outlet collection will be the order you see when run the app.
I can think of supporting several sections by linking their cells to several outlet collections.