Chandu
Chandu

Reputation: 695

AlertView Should Disappear On Its Own

How to make the alertview disappear on its own without using any cancel buttons.?

Upvotes: 0

Views: 308

Answers (1)

Aravindhan
Aravindhan

Reputation: 15628

use this...

-(void)showAlertView
{
   // code for showing your alertView
   [self performSelector:@selector(dismissAlertView) withObject:yourObject afterDelay:5]
}

-(void)dismissAlertView
{
    [yourAlert dismissWithClickedButtonIndex:0 animated:YES];
}

Upvotes: 7

Related Questions