title: Dismiss all UIAlertview from application in iOS7
body: <p>I want to remove all UIAlertview in my application when i enter to background mode. I am using the following code to do that.</p>
  
  <pre><code>for (UIWindow* w in [UIApplication sharedApplication].windows)
      for (NSObject *o in w.subviews)
      {
          if ([o isKindOfClass:[UIAlertView class]])
          {
              [(UIAlertView *)o dismissWithClickedButtonIndex:[(UIAlertView *)o cancelButtonIndex] animated:YES];
          }
      }
  </code></pre>
  
  <p>It is working properly in iOS6. When i run the same application in iOS7 device it is not working. Have any ideas?</p>