Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-18332] iOS: Fixes app crash when deleting last row of tableview #6559

Merged
merged 1 commit into from
Jan 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions iphone/Classes/TiUITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,9 @@ -(UIView*)titleViewForText:(NSString*)text footer:(BOOL)footer
-(TiUITableViewRowProxy*)rowForIndexPath:(NSIndexPath*)indexPath
{
TiUITableViewSectionProxy *section = [self sectionForIndex:[indexPath section]];
if (!indexPath || [section rowCount] <= [indexPath row]) {
return nil;
}
return [section rowAtIndex:[indexPath row]];
}

Expand Down Expand Up @@ -2366,9 +2369,12 @@ - (NSString *)tableView:(UITableView *)ourTableView titleForDeleteConfirmationBu
return result;
}

- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath{
- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
TiUITableViewRowProxy *row = [self rowForIndexPath:indexPath];
[row.section reorderRows];
if (row) {
[row.section reorderRows];
}
}

- (void)tableView:(UITableView *)ourTableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
Expand Down