My didSelectRowAtIndexPath:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
[self.view removeFromSuperview];
[self.view.superview addSubview:commentsViewController.view];
[UIView commitAnimations]; }
I added my CommentsViewController class into root .h file. commentsViewController is variable of this class. After clicking my super view disappears but new view is not inserting. In what my problem?
You are calling self.view removeFromSuperView and after that propably you don’t have reference to super view because you removed it from superview, you have to first call superview addSubView and after that self.view remove from superView