How to dismiss all the alertview from an array when select the cancel button in alertview? I have 5 alertview in an array.. if i choose cancel from the first alertview then it will need to close remaining all alert instead of display.
for (NSDictionary *temp in [RMUserDefaults userDetails].SharedFolders)
{
NSString *name = temp[@"Name"];
sharedFolderId = [RMUserDefaults userDetails].SharedFolders[0][@"id"];
alert1= [[CustomUIAlertView alloc]initWithTitle:LString(@"RECEIPT_MATCH") message:[NSString stringWithFormat:@"%@ has SharedFolders you to a Team Plan.", name] delegate:self cancelButtonTitle:LString(@"CANCEL") otherButtonTitles:[NSMutableArray arrayWithObjects:LString(@"Upgrade Now"),nil]];
alert1.tag = 12365;
[alert1 show];
double delayInSeconds = 5.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
});
}