Skip to content

Instantly share code, notes, and snippets.

@pita5
Created October 23, 2012 16:16
Show Gist options
  • Save pita5/3939795 to your computer and use it in GitHub Desktop.
Save pita5/3939795 to your computer and use it in GitHub Desktop.
__block CSMCacheResponse* cachedResponse = nil;
__weak CSMCache* weakSelf = self;
dispatch_sync(requestQueue, ^{
// Keep the weak self until function returns
__strong CSMCache* strongSelf = weakSelf;
// assign cachedResponse
});
return cachedResponse;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment