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

Crash when progress value changes is too small #120

Open
alexchan1680 opened this issue Apr 8, 2016 · 0 comments
Open

Crash when progress value changes is too small #120

alexchan1680 opened this issue Apr 8, 2016 · 0 comments

Comments

@alexchan1680
Copy link

@implementation MRCircularProgressView {
    int _valueLabelProgressPercentDifference;
}

As you declared that variable as int, it is crashing here.

// Add timer to update valueLabel
    _valueLabelProgressPercentDifference = (progress - self.progress) * 100;
    CFTimeInterval timerInterval =  self.animationDuration / ABS(_valueLabelProgressPercentDifference);
    self.valueLabelUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:timerInterval
                                                                  target:self
                                                                selector:@selector(onValueLabelUpdateTimer:)
                                                                userInfo:nil
                                                                 repeats:YES];

if progress - self.progress value is smaller than 0.001 then 100% crash because difference becomes zero.
I found it when reporting progress from CloudKit asset download and I did nothing tricky to make it crash.

I am not sure if this is bug or not :), but wanted to let you know.

Thanks.

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

1 participant