In this case (below) use only strong self , because the block is copied only in these few seconds. And usually, if you want self execute a block, you want it to stay alive until then, so a strong link is fine.
[self performBlock:^{ [self doSomething];
Block inside a block? In your case, these two blocks are simply delayed by single-block blocks, so use the strong ones just like above. But there are differences between the blocks. If you are storing a block for a longer time , perhaps for several calls you should avoid saving cycles.
Example:
self.callback = ^{ [self doSomething];
This may cause a save loop. Actually, it depends on how the block is used. We see that the block is saved (copied) in the property for later use. However, you can prevent cycles from being saved by destroying a block that will no longer be used. In this case:
self.callback(); //invoke self.callback = nil; //release
When using ARC, you do not need to copy blocks yourself. There were errors in earlier versions after adding blocks, but now the compiler under ARC knows when to copy blocks. It is smart enough to copy it in this case:
[self performSelector:@selector(executeBlockAfterDelay:) withObject:block afterDelay:delay]
source share