Thursday, 9 May 2013

Remove UIAlertview from window | background


for (UIWindow *v in [[UIApplication sharedApplication] windows]) {
      NSLog(@"Window Description : %@",v.description);
      for (UIView *vv in [v subviews]) {
          if([[vv description] hasPrefix:@"<UIAlert"] == YES){
               UIAlertView *al = (UIAlertView *) vv;
               [al dismissWithClickedButtonIndex:0 animated:NO];
            }
      }
}

No comments:

Post a Comment