From b601af8680e7ae8f8357d82866b9f40d9e345f8e Mon Sep 17 00:00:00 2001 From: kingste <649925026@qq.com> Date: Fri, 12 Jun 2020 17:58:43 +0800 Subject: [PATCH] Fix break a strong reference cycle --- SCLAlertView/SCLAlertView.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SCLAlertView/SCLAlertView.m b/SCLAlertView/SCLAlertView.m index e148a2a..3e02483 100755 --- a/SCLAlertView/SCLAlertView.m +++ b/SCLAlertView/SCLAlertView.m @@ -984,8 +984,9 @@ - (SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)ima { SCLButton *btn = _buttons[buttonTimer.buttonIndex]; btn.timer = buttonTimer; + __weak __typeof(self) weakSelf = self; [buttonTimer startTimerWithTimeLimit:duration completed:^{ - [self buttonTapped:btn]; + [weakSelf buttonTapped:btn]; }]; } else