Skip to content

Instantly share code, notes, and snippets.

@stigi
Created July 30, 2014 12:23
Show Gist options
  • Select an option

  • Save stigi/11cccd6778ebd83aae49 to your computer and use it in GitHub Desktop.

Select an option

Save stigi/11cccd6778ebd83aae49 to your computer and use it in GitHub Desktop.
Bad idea
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);
@stigi
Copy link
Copy Markdown
Author

stigi commented Jul 30, 2014

Please ignore the fact that setting the stop BOOL asynchronously never worked anyway ;)

@stigi
Copy link
Copy Markdown
Author

stigi commented Jul 30, 2014

@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