Created
November 28, 2011 21:51
-
-
Save ddribin/1402246 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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