I've been hitting this bug that I don't know what is wrong. When I debug this code and it hits here the program will lock up when it hit the addSubView line and says
terminating_due_to_uncaught_exception
I'm not sure if I'm forgetting something in interface builder or what but the codes does compile.
ViewTypeView is the View's controller class that I am trying to change to.
viewTypeView is the name of the class
-(void)flipToTypeFromMain
{
ViewTypeView * aTypeView = [[ViewTypeView alloc] initWithNibName:@"TypeView" bundle:nil];
[self setViewTypeView:aTypeView];
[aTypeView release];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES];
[viewController.view removeFromSuperview];
//Stops here
[self.window addSubview:[viewTypeView view]];
[UIView commitAnimations];
}