What i am trying to achieve is go to another view when my alert view button is clicked. My alert view is inside my loadingView, this alert view is called from another class called classA.
This is how it is called in classA.
[LoadingViewController showError];
This is the method in loadingView in loadingView class.
+ (void)showDestinationError{
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Error"
message:@"Error"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
alert.tag = DEST_ERR;
[alert show];
}
Button action
+ (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(alertView.tag = DEST_ERR){
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
UINavigationController *secondView = [storyboard instantiateViewControllerWithIdentifier:@"NavigationController"];
secondView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[secondView presentModalViewController:secondView animated:YES];
}
}