Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you are doing the hiding and showing all within the same event callback, you haven't gave it a chance to actually update the gui. If your work is going to take alot of time(like the 15 seconds), you could use NSOperation to do the operation and have when the finish callback occurs then hide your view.</p> <p><a href="http://developer.apple.com/iphone/library/documentation/cocoa/Reference/NSOperation_class/Reference/Reference.html" rel="nofollow noreferrer">http://developer.apple.com/iphone/library/documentation/cocoa/Reference/NSOperation_class/Reference/Reference.html</a></p> <p>this might be easier for you to use: <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/NSInvocationOperation_Class/Reference/Reference.html#//apple_ref/occ/cl/NSInvocationOperation" rel="nofollow noreferrer">http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/NSInvocationOperation_Class/Reference/Reference.html#//apple_ref/occ/cl/NSInvocationOperation</a></p> <p>When you want to update the gui, make sure you do from the main thread not from the event in the NSOperation method:</p> <p>You can use this method to run the selector in the main thread. <a href="http://developer.apple.com/iphone/library/documentation/cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/performSelectorOnMainThread:withObject:waitUntilDone" rel="nofollow noreferrer">http://developer.apple.com/iphone/library/documentation/cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/performSelectorOnMainThread:withObject:waitUntilDone</a>:</p> <p>For a better answer: In the code doing the loading the one that was doing the work to get the data do:</p> <pre><code>// Code to show loading gui [[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(refreshData) object:nil] autorelease]; </code></pre> <p>Then for refreshData:</p> <pre><code>- (void) refreshData { // do the work [self performSelectorOnMainThread:@selector(doneRefresing) withObject:nil waitUntilDone:NO] ; } </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