I am programmatically creating a tableview in objective c. How can I make the cells static programmatically?
Thanks
You could also do it the old fashioned and just create the cell the way you want depending on the NSIndexPath
, this works with Static Cell TVC's and regular table views (don't forget to return the proper number of sections and rows in their datasource methods):
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
switch indexPath.row {
case 0:
// First cell, setup the way you want
case 1:
// Second cell, setup the way you want
}
// return the customized cell
return cell;
}