0

UIAlertview in iOS7 is not getting dismissed when it got dismissed in childclass but not in parentclass. Any solution for it?

UIAlertView  *alertView=[[[UIAlertView alloc]initWithTitle:@"" 
                                                   message:@"Please Select the Start Date"
                                                  delegate:self
                                         cancelButtonTitle:@"Ok"
                                                   otherButtonTitles:nil] autorelease];
[alertView show];

Delegate Method:

#pragma UIAlertView Delegate
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if (buttonIndex==0) {
        [alertView dismissWithClickedButtonIndex:0 animated:YES];
    }
}
Gabriel.Massana
  • 8,165
  • 6
  • 62
  • 81
  • alertview automatically dismissed if you doesn't set delegate for it as you have only cancel button. – Max Jun 25 '14 at 10:36
  • use the `–alertView:didDismissWithButtonIndex:` instead of `–alertView:clickedButtonAtIndex:` in your delegate class. – holex Jun 25 '14 at 10:39

0 Answers0