Re: Show UIActivityIndicatorView asynchronously
Re: Show UIActivityIndicatorView asynchronously
- Subject: Re: Show UIActivityIndicatorView asynchronously
- From: Alexander Spohr <email@hidden>
- Date: Thu, 28 Apr 2011 16:04:35 +0200
Am 28.04.2011 um 12:26 schrieb Philip Vallone:
> Hi,
>
> I have a UIViewController that can take a few seconds to load. The view searches an XML file and eventually displays the resuts. I want to show a UIActivityIndicatorView while the view loads. Unfortunately they are on the same thread. How can I get the UIActivityIndicatorView to display befiore the view loads?
You can not. The display will wait for the end of the runloop.
> With the below code, the UI freezes up (indicator never shows) until the search is done.
Your UI would still freeze, even if you could get the indicator on screen.
> [self.activityIndicator startAnimating];
>
> TitleSearchResultsViewController *controller = [[TitleSearchResultsViewController alloc] initWithNibName:@"TitleSearchResultsViewController" bundle:nil];
> [controller setTitle:@"Search Results"];
Your controller needs to to its work in another thread and signal the main thread if it is done.
atze
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden