Table of contents
Share Post

You surely often see on several application an UIAlertView telling you to wait until something happens (sending information to a server, etc) like this :

Well it can easily be done using a « normal » UIAlertView with some simple customization :

//::.. Preparing a new Alert then show it ..::
UIAlertView *alert;
//::.. this is an Alert with NO buttons ..::
alert = 
[[[UIAlertView alloc] initWithTitle:@"Configuring PreferencesnPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease]; ; //::.. create a new UIActivityIndicator ..:: UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; //::.. place it into the UIAlert and center it ..:: indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50); [indicator startAnimating]; ; [indicator release]; //::.. That's it ;) ..::

Now, when you want to make it disappear, you must « simulate » the user touch on the normal Cancel button like this :

;