Let\'s say I have 3 view controller labeled \"A\",\"B\" and \"C\". Right now, \"A\" is the rootViewController of the window and it presents \"B\" modally when a button is ta
you can do using protocol let say for example as bellow:-
In to your B viewController setting Protocol :
@class Bviewcontroller;
@protocol BviewControllerDelegate
- (void)BviewcontrollerDidTapButton:
(Bviewcontroller *)controller;
@end
@interface Bviewcontroller : UIViewcontroller
@property (nonatomic, weak) id delegate;
- (IBAction)ButtonTap:(id)sender;
@end
in .m class
- (IBAction)ButtonTap:(id)sender
{
[self.delegate BviewcontrollerDidTapButton:self];
}
Now in to you A_viewController .h class:
#import "Bviewcontroller.h"
@interface A_viewController : UIViewcontroller
.m class
- (void)BviewcontrollerDidTapButton:
(Bviewcontroller *)controller
{
[self dismissViewControllerAnimated:YES completion:^{
// here you can create a code for presetn C viewcontroller
}];
}
IMPORTANT when you preseting Bviewcontroller from A_viewController do not set delegate with object like
-(void)presentNextViewCon
{
bViewcontroller *gestureViewCon = [[bViewcontroller alloc]init];
gestureViewCon.delegate = self;
[self presentViewController:gestureViewCon animated:YES completion:nil];
}
UPDATE
Here it is i create a demo that working like:

SAMPLE CODE LINK http://speedy.sh/2acSC/modelDemo.zip