title: iphone setRightBarButtonItem from AppDelegate
body: <p>I am trying to set the right button of the navbar from within the appDelegate, the code compiles and executes without error but the button does not appear. </p>
  
  <p>Any assistance would be appreciated.</p>
  
  <p>Thanks.</p>
  
  <pre><code>NSAutoreleasePool *apool = [[NSAutoreleasePool alloc] init];
      UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
      UIBarButtonItem *activityButtonItem = [[UIBarButtonItem alloc] initWithCustomView:aiv];
      [aiv startAnimating]; 
      [aiv release];
  
  
      [self.navigationController.navigationItem setRightBarButtonItem:activityButtonItem animated:YES];
      [activityButtonItem release];
      [apool release];
  </code></pre>