• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Show UIActivityIndicatorView asynchronously
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Show UIActivityIndicatorView asynchronously


  • Subject: Re: Show UIActivityIndicatorView asynchronously
  • From: Philip Vallone <email@hidden>
  • Date: Thu, 28 Apr 2011 13:54:54 -0400

Thanks. Works like a charm.

Regards,

Phil

Sent from Phil's iPhone

On Apr 28, 2011, at 1:38 PM, Matt Neuburg <email@hidden> wrote:

> On Thu, 28 Apr 2011 06:26:17 -0400, Philip Vallone <email@hidden> said:
>> 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? With the below code, the UI freezes up (indicator never shows) until the search is done.
>>
>> [self.activityIndicator startAnimating];
>>
>> TitleSearchResultsViewController *controller = [[TitleSearchResultsViewController alloc] initWithNibName:@"TitleSearchResultsViewController" bundle:nil];
>> [controller setTitle:@"Search Results"];
>
> Use delayed performance. Here's sample code from one of my own apps:
>
> - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
>    [act startAnimating];
>    // jump out using delayed performance, to give us a chance to start animating the UIActivityIndicatorView
>    [self performSelector:@selector(showItemsForRow:) withObject:indexPath afterDelay:0.1];
> }
>
> And then showItemsForRow inits the view controller and loads its view in the usual way. m.
>
> --
> matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
> A fool + a tool + an autorelease pool = cool!
> Programming iOS 4!
> http://www.apeth.net/matt/default.html#iosbook
_______________________________________________

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

References: 
 >Re: Show UIActivityIndicatorView asynchronously (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Show UIActivityIndicatorView asynchronously
  • Next by Date: Re: Aliases with NDAlias not appearing where I tell them to be.
  • Previous by thread: Re: Show UIActivityIndicatorView asynchronously
  • Next by thread: Accessing NSWIndowController attribute from a subview in IB
  • Index(es):
    • Date
    • Thread