DZNEmptyDataSet icon indicating copy to clipboard operation
DZNEmptyDataSet copied to clipboard

Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior

Open 368433 opened this issue 7 years ago • 1 comments

Hello,

I am using Xcode 10 and just added this library to test in my project (current version 1.8.1). I am still getting the warning: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior in file UIScrollView+EmptyDataSet.m at line void(^fadeInBlock)(void) = ^{_contentView.alpha = 1.0;};

Any idea how to fix it ? Thank you

368433 avatar Dec 04 '18 11:12 368433

You can ignore this warning. If you have obsessive-compulsive disorder, you can do this:

__weak typeof(self) weakSelf = self;
    void(^fadeInBlock)(void) = ^{
        __strong typeof(weakSelf) strongSelf = weakSelf;
        strongSelf -> _contentView.alpha = 1.0;
    };

XiangqiTu avatar Dec 14 '18 07:12 XiangqiTu