I have a app with a main viewcontroller that loads a "first page" viewcontroller. once the user has clicked a few buttons, I exchange the "first page: view controller for the second this way:
[UIView transitionFromView:self.view toView:self.secondPageVC.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromRight completion:^(BOOL done ) {
[self.view removeFromSuperview];
}];
In order to do this I include the header file of the "next page" that is going to load and create a instance of that next page in the class of the current View controller.
All of this works fine until i get to the last page. One of the button combinations sends the user back to the first page. However when I try to include the header file of the first page in the last page, I get errors. What I think is happening is that each view controller class has an instance of the next page within its definition and when we get to the last page, adding an instance of the first page causes a loop that the compiler does not like. Can someone explain to me what I am doing wrong? If I am not supposed to use view controllers like this, how should I set up a game that has 10 pages that can loop back to the first page?