Solution 1:
You could use delegation to do this.
You could define a protocol, say, RootViewControllerDelegate.
RooViewController would have a delegate that conforms to this protocol.
Your TopViewController would conform to this protocol, which could have a method such as -RootViewControllerCompletedSomeThing, which the RootViewController could send when it is finished.
In TopViewController's implementation of this method, it could dismiss/pop RootViewController, and do whatever else it is that you want to do when RootViewController has been dismissed.
Solution 2:
You ca set NSUserDefaults to every view controller.
For example For ViewController A
[[NSUserDefaults standardUserDefaults] setObject:@"Yes" forKey:@"ViewControllerA"];
For example For ViewController B
[[NSUserDefaults standardUserDefaults] setObject:@"Yes" forKey:@"ViewControllerB"];
For example For ViewController C
[[NSUserDefaults standardUserDefaults] setObject:@"Yes" forKey:@"ViewControllerC"];
And In A Viewcontroller ViewDidLoad check belowCondition
-(Void)ViewDidLoad { if([[NSUserDefaults standardUserDefaults]ValueForKey:@"ViewControllerC"] isEqualToString:@"Yes"]) { //Write your code. } }