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 getting crashed at the line [_Mytableviewobject endUpdates];
Crash Log=Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cell animation stop fraction must be greater than start fraction'
code section:
-(void)sectionHeaderView:(SectionHeaderView*)sectionHeaderView sectionOpened:(NSInteger)sectionOpened { //ENSLog(self, _cmd); [_caseTable reloadData]; NSInteger countOfRowsToInsert = 1; SectionInfo *sectionInfo = [self.sectionInfoArray objectAtIndex:sectionOpened]; sectionInfo.open = YES; NSMutableArray *indexPathsToInsert = [[[NSMutableArray alloc] init] autorelease]; for (NSInteger i = 0; i < countOfRowsToInsert; i++) { [indexPathsToInsert addObject:[NSIndexPath indexPathForRow:i inSection:sectionOpened]]; } NSMutableArray *indexPathsToDelete = [[[NSMutableArray alloc] init] autorelease]; NSInteger previousOpenSectionIndex = self.openSectionIndex; if (previousOpenSectionIndex != NSNotFound) { SectionInfo *previousOpenSection = [self.sectionInfoArray objectAtIndex:previousOpenSectionIndex]; previousOpenSection.open = NO; [previousOpenSection.headerView toggleOpenWithUserAction:NO]; NSInteger countOfRowsToDelete = 1; for (NSInteger i = 0; i < countOfRowsToDelete; i++) { [indexPathsToDelete addObject:[NSIndexPath indexPathForRow:i inSection:previousOpenSectionIndex]]; } } // Style the animation so that there's a smooth flow in either direction. UITableViewRowAnimation insertAnimation; UITableViewRowAnimation deleteAnimation; if (previousOpenSectionIndex == NSNotFound || sectionOpened < previousOpenSectionIndex) { insertAnimation = UITableViewRowAnimationTop; deleteAnimation = UITableViewRowAnimationBottom; } else { insertAnimation = UITableViewRowAnimationTop; deleteAnimation = UITableViewRowAnimationTop; } // Apply the updates. [_caseTable beginUpdates]; [_caseTable deleteRowsAtIndexPaths:indexPathsToDelete withRowAnimation:deleteAnimation]; [_caseTable insertRowsAtIndexPaths:indexPathsToInsert withRowAnimation:insertAnimation]; [_caseTable endUpdates]; //ExNSLog(self, _cmd); self.openSectionIndex = sectionOpened; //ExNSLog(self, _cmd); } -(void)sectionHeaderView:(SectionHeaderView*)sectionHeaderView sectionClosed:(NSInteger)sectionClosed { //ENSLog(self, _cmd); SectionInfo *sectionInfo = [self.sectionInfoArray objectAtIndex:sectionClosed]; sectionInfo.open = NO; NSInteger countOfRowsToDelete = [_caseTable numberOfRowsInSection:sectionClosed]; if (countOfRowsToDelete > 0) { NSMutableArray *indexPathsToDelete = [[[NSMutableArray alloc] init] autorelease]; for (NSInteger i = 0; i < countOfRowsToDelete; i++) { [indexPathsToDelete addObject:[NSIndexPath indexPathForRow:i inSection:sectionClosed]]; } [_caseTable deleteRowsAtIndexPaths:indexPathsToDelete withRowAnimation:UITableViewRowAnimationTop]; } self.openSectionIndex = NSNotFound; //ExNSLog(self, _cmd); }
Whenever the numerator of the fraction is lesser than the denominator, the fraction is lesser than one. For example, 1 2 , 9 13, etc. On the other hand, whenever the numerator of the fraction is greater than the denominator, it is a fraction more than 1. Some examples of the fractions that are greater than 1 are as follows: 5 2, 25 20, etc.
After all, Excel doesn't store fractions, it stores decimal values. You can, however, change the format used by Excel to display the value in a particular cell. For instance, if you wanted the cell into which you entered 18/28 to display the fraction with 28 as the denominator, then you could follow these steps: Select the cell you want to format.
Improper Fraction - The numerator part is greater than or equal to the denominator. The fraction is greater than or equal to 1. For example, 5/2, 25/20, etc.
Once entered as text, you cannot use the fraction in any calculations. If this is a problem for your needs, then you may want to consider putting the numerator in one cell and the denominator in another cell. This provides a way to remember what you entered, but still be able to use the numerator and denominator in a formula.
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];
Yes i also face this type of problem,do one thing just remove footer view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With