Will this lead to any sort of retain cycle? Is it safe to use?
__block void (^myBlock)(int) = [^void (int i)
{
if (i == 0)
return;
NSLog(@\"
I wanted a solution that gets no warnings, and in this thread https://stackoverflow.com/a/17235341/259521 Tammo Freese gives the best solution:
__block void (__weak ^blockSelf)(void);
void (^block)(void) = [^{
// Use blockSelf here
} copy];
blockSelf = block;
// Use block here
His explanation makes perfect sense.