2012-03-25 64 views
1

我didSelectRowAtIndexPath方法後添加在上海華新觀點:點擊行的tableView

-(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]; } 

我說我CommentsViewController類爲根.h文件中。 commentsViewController是這個類的變量。點擊我的超級視圖後消失,但未插入新視圖。在我的問題?

回答

3

要調用self.view removeFromSuperView,之後propably因爲你從上海華盈刪除它,你不必引用超級看法,你必須先調用上海華addSubView和self.view後刪除的SuperView

+0

其實我不需要從超級角度去除某些東西,這是我的錯誤。問題是將新視圖插入超視圖。 – RomanHouse 2012-03-25 21:38:40

相關問題