2011-07-19 4 views
1

私はiPhoneアプリを使っています。presentModalViewController iPhone

ProfileViewController *ProfilePage = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil]; 
ProfilePage.RequestType = 2; 
ProfilePage.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 

UINavigationController *navigationControllerNew = [[UINavigationController alloc] initWithRootViewController:ProfilePage]; 

//Present navigationController as Model viw controller 
[self.navigationController presentModalViewController:navigationControllerNew animated:YES]; 

//release it After presenting to it 
[navigationControllerNew release]; 
[ProfilePage release]; 

そのが正常に動作しますが、私はProfileViewControllerの「ラストビュー」ボタンをクリックした後に戻って同じページに来るとき、それは再びが、後に戻ってくる:私は、次のコードで(HomeViewControllerから)ProfileViewControllerにジャンプしなければなりません戻ってくる。戻るボタンのpopToViewControllerがHomeScreenControllerで機能しません。スタック内の新しいナビゲーションコントローラが原因である可能性があります。

私は間違いを犯していますか?戻るボタンをもう一度動かすためにどのように実装できますか?

答えて

1

を動作するはず

UINavigationController *navigationControllerNew = [[UINavigationController alloc] initWithRootViewController:ProfilePage]; 

を必要としません。

dismissModalViewControllerAnimated:の方法を使用してホームビューに戻ります。

+0

を。今はうまくいきます。 –

+0

あなたは大歓迎です。 – Ilanchezhian

2

あなたは、これはあなたがpopToViewControllerか何かを使用する必要はありません

[self.navigationController presentModalViewController:ProfilePage animated:YES]; 
0

次のコマンドを使用することができます:あなたの助けのおかげで、おかげで多くのことを

[self presentModalViewController:ProfilePage animated:YES] 
関連する問題