fix delete messages

This commit is contained in:
Danmei Chen 2019-02-22 17:14:21 +01:00
parent 4ea81a0730
commit 957a14e1af

View file

@ -318,9 +318,9 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f;
LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue];
linphone_event_log_delete_from_database(event);
[eventList removeObjectAtIndex:indexPath.row];
NSInteger index = indexPath.row + _currentIndex;
NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count);
if (index < totalEventList.count)
[totalEventList removeObject:[NSNumber numberWithInteger:index]];
[totalEventList removeObjectAtIndex:index];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationBottom];
@ -366,9 +366,9 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f;
LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue];
linphone_event_log_delete_from_database(event);
[eventList removeObjectAtIndex:indexPath.row];
NSInteger index = indexPath.row + _currentIndex;
NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count);
if (index < totalEventList.count)
[totalEventList removeObject:[NSNumber numberWithInteger:index]];
[totalEventList removeObjectAtIndex:index];
}];
}