I'm trying to dismiss a UIAlertView before showing another and I found the answer here: iOS dismiss UIAlertView beforing showing another
The problem is that this is not working on iOS7 but works on iOS6.
This is working in iOS6
-(void)closePreviousAlert{
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];
}
Is there another solution for this?
See Question&Answers more detail:os