"UIAlertView without Buttons"

Sat 12 March 2011

//Declare in class following vairiable

UIAlertView *alert;

 

-(void)showAlert{

    alert = [[[UIAlertView alloc] initWithTitle:@"Please Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];

    

    [alert show];

 

    UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

 

    indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);

    [indicator startAnimating];

    [alert addSubview:indicator];

    [indicator release];

}

 

-(void)dismissAlert{

    [alert dismissWithClickedButtonIndex:0 animated:YES];

    [alert release];

}