Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @protocol MyBackgroundTaskDelegate
- @required
- - (void) progress: (float) value; // 0.0…1.0
- @optional
- - (void) workingOn: (NSString*) msg; // @"Doing this, doing that…"
- @end
- // Starting our background task...
- [MyTask startComputationWithProgressHandler: ^(float progress, NSString* msg)
- {
- // Switching to the main thread because all UI stuff should go there...
- dispatch_async(dispatch_get_main_queue(), ^()
- {
- self.progressIndicator.progress = progress;
- self.informationalMessage = msg;
- });
- }];
- @property(readonly, atomic) float progress;
- @property(readonly, atomic) NSString* message;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement