You need to make the alert view a property of the class, so.
1 - Declare a property (alert) of type BlockAlertView
in the class that make the multiple requests (let's call it RequesterClass). This property will reference an unique alert view, which will be displayed only once.
2 - Put this 2 lines in the init method of the RequesterClass
_alert = [BlockAlertView alertWithTitle:@"Connection Failed" message:@"Connection to web service Failed. Please try again."];
[_alert addButtonWithTitle:NSLocalizedString(@"OK", nil) block:^{ }];
3 - Modify the verifyDeviceStatusParserDidFailWithError:
as follows:
- (void)verifyDeviceStatusParserDidFailWithError:(NSString *)error
{
NSString *errorString = [NSString stringWithFormat:@"Error =%@", [error description]];
NSLog(@"Error parsing XML: %@", errorString);
if(!alert.visible)
{
[alert show];
}
[activityIndicator stopAnimating];
self.navigationController.view.userInteractionEnabled = YES;
}
Hope it helps!