Guest User

Untitled

a guest
Jul 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. @implementation TestBedViewController
  2. - (void) performDismiss
  3. {
  4. [baseAlert dismissWithClickedButtonIndex:0 animated:NO];
  5. }
  6.  
  7. - (void) action: (UIBarButtonItem *) item
  8. {
  9. baseAlert = [[[UIAlertView alloc]
  10. initWithTitle:@"Please Wait" message:nil
  11. delegate:self cancelButtonTitle:nil
  12. otherButtonTitles: nil] autorelease];
  13. [baseAlert show];
  14.  
  15. // Create and add the activity indicator
  16. UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc]
  17. initWithActivityIndicatorStyle:
  18. UIActivityIndicatorViewStyleWhiteLarge];
  19. aiv.center = CGPointMake(baseAlert.bounds.size.width / 2.0f,
  20. baseAlert.bounds.size.height - 40.0f);
  21. [aiv startAnimating];
  22. [baseAlert addSubview:aiv];
  23. [aiv release];
  24.  
  25. // Auto dismiss after 3 seconds
  26. [self performSelector:@selector(performDismiss) withObject:nil
  27. afterDelay:3.0f];
  28. }
  29.  
  30. // ...Other
  31.  
  32. @end
Add Comment
Please, Sign In to add comment