Skip to content

Commit

Permalink
Merge pull request #8870 from vijaysingh-axway/TIMOB-24067
Browse files Browse the repository at this point in the history
[TIMOB-24067]:List view crash when deleting rows with "pruneSectionsOnEdit" set
  • Loading branch information
longton95 committed Mar 9, 2017
2 parents d0ecb27 + 6963b33 commit e141ad6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,12 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
[self fireEditEventWithName:@"delete" andSection:theSection atIndexPath:indexPath item:theItem];
[theItem release];

BOOL emptyTable = NO;
NSUInteger sectionCount = [[self.listViewProxy sectionCount] unsignedIntValue];
if ( sectionCount == 0) {
emptyTable = YES;
}

BOOL emptySection = NO;

if ([theSection itemCount] == 0) {
Expand All @@ -1120,13 +1126,7 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
[self.listViewProxy deleteSectionAtIndex:indexPath.section];
}
}

BOOL emptyTable = NO;
NSUInteger sectionCount = [[self.listViewProxy sectionCount] unsignedIntValue];
if ( sectionCount == 0) {
emptyTable = YES;
}


//Reload the data now.
[tableView beginUpdates];
if (emptyTable) {
Expand Down

0 comments on commit e141ad6

Please sign in to comment.