I am presenting a modalviewcontroller from another modalviewcontroller. When I dismiss the second modalviewcontroller both the first and second modalviewcontroller should get dismissed. I tried to access the first modalview like
[self.view.superview dismissmodalviewcontroller];
but it is showing error. What is the right way to get a ref to the first modalViewController from the second one and invoke the dismiss method from it?