2011-04-25 122 views
1

我想從子視圖導航到另一個視圖。我已經編寫了代碼,但它從這個視圖導航。請幫助我解決這個問題。如何從子視圖導航到另一個視圖

NSLog(@"selected tag:%d",[sender tag]); 
UserViewController *uViewController=[[UserViewController alloc] initWithNibName:@"UserViewController" bundle:nil]; 
uViewController.usersArray=self.usersArray; 
uViewController.accessingIndex=[sender tag]; 
self.userViewController=uViewController; 

[self.navigationController pushViewController:self.userViewController animated:YES]; 
[uViewController release]; 

回答

1

您可以使用此方法來顯示一個視圖

[self presentModalViewController:uViewController animated:YES] 

要關閉它使用:

[self dismissModalViewControllerAnimated:yes] 
相關問題