Alert when web query is in progress?
<p>I was stopped in my work by a small problem: my application contains some web queries, which are almost immediately performed if wifi connection is used,  however they need a couple of seconds to finish in case of 3G or even EDGE connection. During this period, I would like to indicate to the user that the query is in progress, e.g. by displaying a message on a label.</p>

<p>The code looks something like this:</p>

<pre><code>-(void)query{
    alertLabel.text = @"in progress…";

    // the query follows...
    NSString *queryURLstring = [NSString stringWithFormat:@"http://xyz.xyz"];
    NSURL *queryURL = [[NSURL alloc] initWithString:queryURLstring];
    NSString *receivedData = [[NSString alloc] initWithContentsOfURL:queryURL];
    //query done

    alertLabel.text = @"";
}
</code></pre>

<p>What happens in practice is that when the query is being executed, the user can not actually do anything. When the requested data is received, the "in progress…" text appears just for a moment and it disappears immediately.
I can not understand that, as this is not how it should work. The text should be displayed on the label before the query is executed, and should be cleared only upon finishing.
Have anyone faced such issue? Can you recommend a solution?
Thanks for all kind of suggestions!
Miv</p>
