diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-03-12 15:08:34 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-03-14 12:54:10 -0700 |
commit | 922269cd7c543df6b5e2b2c649e72099d9320262 (patch) | |
tree | 1dacc845957602cf41c9c620b3211994154573a4 /platform | |
parent | ac541290607e968343490c046e0d4e5f48471bba (diff) | |
download | qtlocation-mapboxgl-922269cd7c543df6b5e2b2c649e72099d9320262.tar.gz |
[ios] Immediately remove offline pack from table
Remove all references to an offline pack before the call to -removePackWithCompletionHander:.
Cherry-picked from d64b8ad25ca7c2297221337d4021924b5103cc77.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/app/MBXOfflinePacksTableViewController.m | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/platform/ios/app/MBXOfflinePacksTableViewController.m b/platform/ios/app/MBXOfflinePacksTableViewController.m index 32e4bfea06..3410f075a1 100644 --- a/platform/ios/app/MBXOfflinePacksTableViewController.m +++ b/platform/ios/app/MBXOfflinePacksTableViewController.m @@ -164,12 +164,9 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { MGLOfflinePack *pack = self.offlinePacks[indexPath.row]; - __weak MBXOfflinePacksTableViewController *weakSelf = self; - [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError *error) { - MBXOfflinePacksTableViewController *strongSelf = weakSelf; - [strongSelf.offlinePacks removeObjectAtIndex:indexPath.row]; - [strongSelf.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; - }]; + [self.offlinePacks removeObjectAtIndex:indexPath.row]; + [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:nil]; } } |