views:

37

answers:

1

Hello,

I have a custom UITableViewCell. However, when I got in edit mode, I don't have any Delete and Move indicators appearing. The custom cell draws itself in the contentView.

In layoutSubviews, I make sure there is space on the left and one the right of the contentView so that the controls can appear (if this was the problem).

- (void)layoutSubviews
{
self.contentView.frame = CGRectMake(50, 0, self.frame.size.width - 100, sub.thumbnail.size.height + 20);
}

In the UITableViewController, I return YES in: - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {

How could I solve this lack of interactivity. Is there something specific for custom cells?

Thanks!

+1  A: 

Important point: always call function on super when you reimplement. This solved my problem:

- (void)layoutSubviews
{
   [super layoutSubviews];
   self.contentView.frame = CGRectMake(50, 0, self.frame.size.width - 100, sub.thumbnail.size.height + 20);
}
Kamchatka
+1 when overriding methods, it's *always* a good idea to call `super` unless you have a very specific reason not to.
Dave DeLong