I m using Animation in table view cell...Animation is working fine when cell is totally visible.if any cell is partially visible at that time due to Animation my app is gett
I experienced the same problem - exception 'Cell animation stop fraction must be greater than start fraction' in [[self tableView] endUpdates]; I solved it by catching the exception and making the endUpdates second time.
[[self tableView] beginUpdates];
@try
{
[[self tableView] endUpdates];
}
@catch (NSException* exception)
{
[[self tableView] endUpdates];
}
I was getting the same error and crash whenever I would scroll to the bottom of the tableview and try to delete cells and insert sections my solution was to scroll the tableview back to the top before calling [tableview beginsUpdates]
using the tableviews content offset. With this solution I didn't have to change my section header or footer at all.
[self.tableView setContentOffset:CGPointZero animated:NO];
I had the same problem after the ios 7 update : crash appeared during a "deleteRowsAtIndexPaths" for expand/collapse stuff in my table view.
Surprisingly, I have solved this issue by using heightForHeaderInsection instead of heightForFooterInSection.
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 1; // it was 0 before the fix } -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return 0; // it was 1 before the fix }
This issue has been reported (https://devforums.apple.com/message/795349).
I experienced the same crash when trying to use a dummy footer to remove potential "empty" table view cells.
The solution was to get rid of
tableView:viewForFooterInSection:
tableView:heightForFooterInSection:
and replace them with the following, in viewDidLoad :
tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
You can use header of next section my same answer is here
https://stackoverflow.com/a/12297703/788798
I solved this bug by calling reloadData() for last section:
func expandSectionPressed(sender: UIButton) {
let object = items[sender.tag]
object.expanded = !object.expanded
sender.selected = object.expanded
var indexPaths = [NSIndexPath]()
for i in 0..<7 {
indexPaths.append(NSIndexPath(forRow: i, inSection: sender.tag))
}
if object.expanded {
tableView.insertRowsAtIndexPaths(indexPaths, withRowAnimation: .Fade)
} else {
// strange crash when deleting rows from the last section //
if sender.tag < numberOfSectionsInTableView(tableView) - 1 {
tableView.deleteRowsAtIndexPaths(indexPaths, withRowAnimation: .Fade)
} else {
tableView.reloadData()
}
}
}