Skip to content

cyclic references #21

@rlaferla

Description

@rlaferla

This code in URBSegmentedControl uses a block that refers to self. The problem is that self will be retained.

        [UIView animateWithDuration:0.4 animations:^{
            [self layoutSegments];
        }];

Instead, it should be something like:

        URBSegmentedControl * __weak weakSelf = self;
        [UIView animateWithDuration:0.4 animations:^{
            URBSegmentedControl * strongSelf = weakSelf;
            if (strongSelf) {
                [strongSelf layoutSegments];
            }
        }];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions