Note that there are some explanatory texts on larger screens.

plurals
  1. PONSProgressIndicator setDoubleValue not working with argument
    text
    copied!<p>I'm using a NSProgressIndicator in my xcode project (Mac OS X, not iOS). I'm trying to do an async download of a file, while showing the progress of the download on a progress indicator. In my project, clicking on the update button starts the download. After each time data is received, progress is updated, and the update_progress method in the app delegate is called. </p> <p>As you can see from the NSLogs, the progress value is passed on to that method. Using setDoubleValue on the progress indicator with this value, has no effect. However, using a static value (e.g. setDoubleValue:50.0f) does update the progress indicator.</p> <p>In .m, the loadData method starts the download. Here you can set the location to save the file (self.strFileNameWithPath), and a few lines below, the location to download the file from. I'm just using a file of 2.5mb, small, but big enough to have a few download steps.</p> <p>In the interface, click the "update" button to start the download. The console will show progress updates, as chunks are received.</p> <p>Would anybody know any reasons to why this is happening, and how I could fix it? Thanks in advance!</p> <p>Edit: The method with the inconsistency is:</p> <pre><code>- (void)update_progress:(float)value{ double thevalue = (double)value; NSLog(@"value: %f",thevalue); [self.progress_indicator setDoubleValue:thevalue]; NSLog(@"Prgoress: %f",[self.progress_indicator doubleValue]); } </code></pre> <p>During each progress step, value shows the correct progress value, but the progress indicator isn't reacting to setDoubleValue since the second NSLog returns 0.0.</p> <p>Below is what the console shows:</p> <pre><code>value: 2.770802 Prgoress: 0.000000 value: 22.662386 Prgoress: 0.000000 value: 69.881004 Prgoress: 0.000000 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload