Uiprogressview not updating
class provides properties for managing the style of the progress bar and for getting and setting values that are pinned to the progress of a task.
I have a UIProgress View set as an IBOutlet and I'm trying to call the set Progress method.
In my View Controller am trying to update UIProgress View using the above downloading status.
When i log Downlaoding status (bytes downloaded) am getting correct value.
Then, if there is, the following line is called 10 times in a function. Update: This is how I am calling the API NSString *url String = **url**; NSURL *JSONURL = [NSURL URLWith String:url String]; NSURLRequest *request = [NSURLRequest request With URL: JSONURL cache Policy: NSURLRequest Reload Ignoring Cache Data timeout Interval:10]; if(connection In Progress) connection In Progress =
The float increments by 0.1 and the loading view displays this. As a rule when you program, you need to set UI operations in the main thread, and heavy, complex and more performance demanding operations in background threads - this is called multithreading (as a side suggestion, would be good to read about GCD - Grand Central Dispatch.Everything I have found has stated to make sure the main thread is free to update the view, but doesn't the fact that NSLog runs mean that it is free? @Matthias Is it possible to do something like, "[progress View perform Selector On Main Thread:@selector(set Progress:) with Object: [NSNumber number With Float: progress] wait Until Done: No];"? Why do we have to call a wrapper method instead of telling the UIProgress View to change its progress on the main thread?