First define your third view identifier
- (void)segue
{
[self performSegueWithIdentifier:@"mySegue" sender:self];
}
for only do any condition or operation use below method
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([[segue identifier] isEqualToString:@"mySegue"]) {
}
}
i created simple sample project for you
https://github.com/iDevAndroid/NavigationSample
try with this. because your are perform model transaction after next line your are using dismiss the model.
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
[self becomeFirstResponder];
[self dismissViewControllerAnimated:YES completion:^{
[self emailDelivaryedSuccessfully];
];
}
-(void)emailDelivaryedSuccessfully{
[self performSegueWithIdentifier: @"secondToThird" sender: self];
}