Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.65 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Auto Click on UIAlertView
  2. [alertView dismissWithClickedButtonIndex:0 animated:YES];
  3.        
  4. - (UIAlertView *) recuresiveSearchAlertViewInView:(UIView *)mainView
  5. {
  6.     if ([mainView isKindOfClass:[UIAlertView class]])
  7.         return (UIAlertView *)mainView;
  8.     UIView *found = nil;
  9.     for (UIView *view in mainView.subviews)
  10.     {
  11.         if ([view isKindOfClass:[UIAlertView class]])
  12.         {
  13.             found = view;
  14.             break;
  15.         }
  16.         if (!found)
  17.             found = [self recursiveSearchAlertViewInView:view];
  18.     }
  19.     return found;
  20. }
  21.        
  22. UIAlertView *av = [self recursiveSearchAlertViewInView:[[UIApplication sharedApplication] keyWindow];