When deleting cells it calls my setEditing:animated: method which i have overridden because I need to adjust the height of my cells when editing, but because of this when I press the edit button the slide in animation of the red circles with the minus signs don't occur, instead they just appear into the cell. How Can I fix this?
This is my setEditing:animated code at the moment
- (void)setEditing:(BOOL)editing animated:(BOOL)animated{
[self.tableView setEditing:editing animated:YES];
[self.tableView reloadData];
[super setEditing:editing animated开发者_开发知识库:animated];
}
Any help will be appreciated! Thanks
There's a reload call just for this purpose. Try:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated{
[self.tableView reloadRowsAtIndexPaths:[self.tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationMiddle];
[super setEditing:editing animated:animated];
}
[self.tblView setEditing:YES animated:YES];
[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(onLoadTable) userInfo:nil repeats:NO];
-(void) onLoadTable
{
[self.tblView reloadData];
}
精彩评论