Sumi-Interactive / SIAlertView

An UIAlertView replacement with block syntax and fancy transition styles.
MIT License
2.51k stars 424 forks source link

Warning: Capturing 'self' strongly in this block is likely to lead to a retain cycle #30

Closed iMinichrispy closed 11 years ago

iMinichrispy commented 11 years ago

I get this warning when I try to call one of my viewcontroller methods using [self alertButton1Method] from within the sialert instance button handler. This only happens when my sialert instance is declared as a global variable (which I need to dismiss the alert at a later point). Everything works fine, I've just never encountered this warning and I'm not sure what problems it can cause down the line. Is this normal behavior, or is there something am I doing wrong?

kyoji2 commented 11 years ago

I think it should be fine. You can use weak self to avoid this warning. weak typeof(&*self)weakSelf = self;

iMinichrispy commented 11 years ago

Thanks, that fixes it.