Skip to content

Instantly share code, notes, and snippets.

@ddribin
Created November 28, 2011 21:51
Show Gist options
  • Save ddribin/1402246 to your computer and use it in GitHub Desktop.
Save ddribin/1402246 to your computer and use it in GitHub Desktop.
-(IBAction)startWorking:(id)sender {
[self showIndeterminateProgressBar];
self.future = [worker startAsyncWork];
[future onCompletion:^(id result, NSError * error) {
// we got a result!
[self hideIndeterminateProgressBar];
self.future = nil;
}];
[future onCancel:^{
// clean up anything that might depend on what we attempt to do in the completion handler
[self hideIndeterminateProgressBar];
self.future = nil;
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment