views:

75

answers:

1

The following code (located in my -viewWillAppear) successfully implements a cell as a tableFooterView:

CGRect cellRect = [self.tableView rectForRowAtIndexPath:0];
    UITableViewCell *footerCell = [[UITableViewCell alloc] initWithFrame:cellRect];
    //footerCell.editingStyle = UITableViewCellEditingStyleInsert;
    footerCell.textLabel.text = @"Add New Class";
    self.tableView.tableFooterView = footerCell;

However, the line that is commented out returns this error: object cannot be set - either readonly property or no setter found

How can I set the editingStyle of this cell to insert?

+1  A: 

Normally UITableViewCell instances are meant to only go into UITableView "rows" and not into the footer itself. However since it is subclass of UIView I guess it will work.

The issue you are having is that it is a readonly property. The information you are trying to set is normally discovered by the UITableView through delegates. Therefore you are trying to put a square peg into a round hole.

I would create a custom UIView to put into your footer instead of trying to put a UITableViewCell in there.

Marcus S. Zarra
That makes sense. Darn pegs :P
Spindler