title: Show activity indicator during application launch
body: <p>I am trying to add an activity indicator during startup. I did have a launch image, but I'd rather have just an indicator alone. I added the following to my app delegate, but the indicator doesn't appear.</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      // *******Create activity indicator****
      UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(225, 115, 30, 30)];
      [activity setBackgroundColor:[UIColor clearColor]];
      [activity setActivityIndicatorViewStyle: UIActivityIndicatorViewStyleGray];
      [window addSubview: activity];
      [activity release];
  
      [activity startAnimating];
      activity.hidden = FALSE;
      // *******End activity indicator****
  
      MainViewController *viewController = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil];
      self.mainViewController = viewController;
  
      [window addSubview:[mainViewController view]];
      mainViewController.view.frame = CGRectMake(0, 20, 320, 411);
  
      [window addSubview:[rootController view]];
      [window makeKeyAndVisible];
  #if !TARGET_IPHONE_SIMULATOR
      [application registerForRemoteNotificationTypes: 
       UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound];
  #endif
  
      application.applicationIconBadgeNumber = 0;
  
      // Hide indicator
      [viewController release];
      activity.hidden = TRUE;
  
      [activity stopAnimating];
      return YES;
  }
  </code></pre>
  
  <p>I visited this question from back in 2009, but the solution didn't work for me.
  <a href="https://stackoverflow.com/questions/1434988/iphone-sdkactivity-indicator-during-startup">iPhone-SDK:Activity Indicator during Startup?</a></p>