ios - Can two weak variables create a retain cycle? -


in arc, if hold strong reference b, , b holds strong ref a, there retain cycle.

will code below create retain cycle?

    __weak myclass *weakself = self;     [self dosomething:^{          weakself.somevariable = yes;          [weakself dosomething:^{              weakself.somevariable = yes;         }];      }]; 

with arc weakself pointer copied, since it's weak, copy of pointer not cause retain count increased. no, doesn't create retain cycle.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -