My tabbar application has three tabs, each with its own navigational structure. Several of the views throughout my app load data via web service calls. These views register this notification in order to know when the app becomes active, so that they can reload the data:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadView) name:UIApplicationDidBecomeActiveNotification
object:NO];
When the app becomes active, these views all try to reload their data; however, if there is no Internet connection, the errors are caught and a UIAlert is shown to the user. The problem is that if 3 of these views are trying to reload data, 3 alert messages pop up.
How do I prevent multiple alerts from popping up to the user?
I appreciate all your thoughts, ideas, and suggestions!!
Thanks!
Brad
Edit: I tried putting this in my appDelegate, but even using this method, I seem to get multiple popups.
-(void)displayAlertWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:delegate cancelButtonTitle:@"Cancel" otherButtonTitles:@"Retry",nil];
[alert show];
[alert release];
}