2

I'm using a "custom" progressView and set the progress property a value like '0.3'

If i code the progressView hardcoded like so

self.progressView.progress = 0.3;

the progress gets drawed... if I call a method which returns a float in a switch-case the debugger shows me the progress is instead of 0.3 0.30000001 and the progress doesn't gets drawed.....

Method:

- (float)getProgressOfStepIndex:(int)stepIndex {
    switch (stepIndex) {
        case 0:
            return 0.1;

        case 1:
            return 0.3;

        case 2:
            return 0.5;

        case 3:
            return 0.7;

        case 4:
            return 0.9;

        default:
            return 0.0;
    }
}

At first I just thought that the drawRect method is wrong, but it can't be because it draws correct if I set the progress hardcoded to 0.3 right?

It runs on iOS6 perfectly, only iOS7 problem!

Christian 'fuzi' Orgler
  • 1,682
  • 8
  • 27
  • 51
  • I don't think the problem is due to number being 0.300001. Floating point numbers can't be stored as 3.0, 0.3. They will always have some value at the end (ex: 2.999999, 0.3000001). – Lord Zsolt Sep 25 '13 at 07:42

0 Answers0