Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory issue in method #6

Open
shattars3d opened this issue Mar 8, 2018 · 3 comments
Open

memory issue in method #6

shattars3d opened this issue Mar 8, 2018 · 3 comments

Comments

@shattars3d
Copy link

shattars3d commented Mar 8, 2018

hey , the method doAnimateCycleWithRects.

the _weak is not needed //__weak typeof(self) wSelf = self; //weak issue
should be typeof(self) wSelf = self;

  • (void)doAnimateCycleWithRects:(NSArray *)rects
    {
    //__weak typeof(self) wSelf = self; //weak issue

    typeof(self) wSelf = self;

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.25 * 0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [wSelf animateRect:rects[0] withDuration:0.25];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.25 * 0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [wSelf animateRect:rects[1] withDuration:0.2];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.2 * 0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [wSelf animateRect:rects[2] withDuration:0.15];
    });
    });
    });
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.6 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [wSelf doAnimateCycleWithRects:rects];
    });
    }

@Asich Asich closed this as completed Jun 11, 2018
@Asich Asich reopened this Jun 11, 2018
@shattars3d
Copy link
Author

@Asich how come you re opened the issue?

@Asich
Copy link
Owner

Asich commented Jun 13, 2018

@shattars3d Accidentally) Are you sure that there is no need for "weak"? How did you come up with it? How did you check that?

@shattars3d
Copy link
Author

well i think depending in the developer is using are or not... I'm using arc so I personally wouldn't need to too call the extra _weak

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

No branches or pull requests

2 participants