Created
July 30, 2014 12:23
-
-
Save stigi/11cccd6778ebd83aae49 to your computer and use it in GitHub Desktop.
Bad idea
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
| MyCrazyBlock block = ^(BOOL *stop) { | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ | |
| // do some work | |
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| *stop = YES; | |
| }); | |
| }); | |
| }; | |
| // in your object | |
| if (block) block(&self.shouldStop); |
Author
Author
@hiDominik: should not make any difference, as ARC only manages object retain counts. we're dealing with a pointer into an objects memory space here. Nothing that could be retained.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please ignore the fact that setting the
stopBOOL asynchronously never worked anyway ;)