Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
Fix potential crash when calling UI code from background thread.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlutsenko committed Nov 30, 2015
1 parent 956fcbf commit 5ad6bf4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#import "PFQueryTableViewController.h"

#import <Bolts/BFExecutor.h>
#import <Bolts/BFTask.h>
#import <Bolts/BFTaskCompletionSource.h>

Expand Down Expand Up @@ -397,8 +398,8 @@ - (void)removeObjectsAtIndexPaths:(NSArray *)indexPaths animated:(BOOL)animated
[allDeletionTasks addObject:[obj deleteInBackground]];
}

[[BFTask taskForCompletionOfAllTasks:allDeletionTasks]
continueWithBlock:deletionHandlerBlock];
[[BFTask taskForCompletionOfAllTasks:allDeletionTasks] continueWithExecutor:[BFExecutor mainThreadExecutor]
withBlock:deletionHandlerBlock];
}

- (PFTableViewCell *)tableView:(UITableView *)otherTableView cellForNextPageAtIndexPath:(NSIndexPath *)indexPath {
Expand Down

0 comments on commit 5ad6bf4

Please sign in to comment.