Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen are a methods GUI operations actually carried out?
    primarykey
    data
    text
    <p>I am working on a web-services data processing app and I am trying to make the app run as quickly as possible. When a certain 3 finger pan gesture is performed, I call a method that sends updated information off to the server to get a new batch of images to update the existing ones with.</p> <p>So lets say there are 15 images in an array, I filter through them with a 2 finger gesture, and then if I want to change something about them, I can do the 3 finger gesture, and I get that same set back, just tweaked a bit (contrast/brightness, etc.).</p> <p>Is what I want though is to be able to update the imageView that is displaying the images after the first image has been retrieved, so as to give the user a feel for what the rest in the series are going to look like. But no matter what I try, and no matter how many different threads I try and implement, I can't get the imageView to update before the entire download is complete. Once the batch download is done (which is handled on a separate thread) the imageView updates with the new images and everything is great.</p> <p>The first step in the process is this:</p> <pre><code>if(UIGestureRecognizerStateEnded == [recognize state]){ [self preDownload:windowCounter Level:levelCounter ForPane:tagNumber];// Where this method is what gets the first image, and tries to set it to the imageView [self downloadAllImagesWithWL:windowCounter Level:levelCounter ForPane:tagNumber]; //And this method goes and gets all the rest of the images } </code></pre> <p>This is my preDownload method:</p> <pre><code>-(void)preDownload:(int)window Level:(int)level ForPane:(int) pane{ int guidIndex = [[globalGuids objectAtIndex:pane] intValue]; UIImage *img = [DATA_CONNECTION getImageWithSeriesGUID:[guids objectAtIndex:guidIndex] ImageID:counter Window:window Level:level]; if(pane==0){ NSLog(@"0"); [imageView3 setImage:img]; }else if(pane==1){ NSLog(@"1"); [imageView31 setImage:img]; }else if(pane==2){ NSLog(@"2"); [imageView32 setImage:img]; }else if(pane==3){ NSLog(@"3"); [imageView33 setImage:img]; } } </code></pre> <p>So by separating this out into two different methods (there are no threads being implemented at this point, these methods are being called before all that) I was thinking that after the preDownload method completed, that the imageView would update, and then control would continue on down into the downloadAllImagesWithWL method, but that doesn't appear to be the case.</p> <p>Am I missing something simple here? What can I do to update my GUI elements before that second method is through running?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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