Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

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

Open
368433 opened this issue Dec 4, 2018 · 1 comment

Comments

@368433
Copy link

368433 commented Dec 4, 2018

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

@XiangqiTu
Copy link

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;
    };

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants