Using below code, I am trying to show a uialertview, it is being shown properly and also my application is going properly to next screen through [self getlogin]; method. The issue I am facing is that alert view does not gets disappear when another view is loaded, as when the [self getLogin] is called alert view should disappear itself and new screen should be shown, while it is not.
Also I want to add a progress bar above the alert view cancel button, How can I do that
if ((user != nil) && (passwd != nil)) {
NSLog(@"Data found");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Signing in..." message:nil delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:nil ];
[alert show];
[self getLogin];
}else {
NSLog(@"No data saved");
}
I am using this alert view on a login screen, if username and password is saved then that alert view will appear and starts signing in automatically through [self getLogin]; and when it gets logged on alert view will be disappear and new screen will be shown, and if while auto signing in user clicks cancel button user will be at login screen
To dismiss an alert view you can use
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animatedand you can add a progress bar simply by adding a subview to the UIAlertView. But you should rethink if a UIAlertView is really the right view for this. It sound strange, a alert view that disappears on int’s own and still has a cancel button. User might be confused when it disappears.