2010-04-01 87 views
0

我有UINavigationController的的UINavigationController和UITableView的

在我的firstView一個問題,我有我button.If點擊按鈕,它應該在secondview打開的tableview。如果我點擊tableviewcell被連接到第三view.it是第二和thirdview用於導航欄

請幫助解決此問題。

回答

0
中的appDelegate

創建這樣我張貼示例代碼navigationcontroller

HomeScreen *homeScreenObject=[[HomeScreen alloc] initWithNibName:@"HomeScreen" bundle:nil]; 
self.navController =[[UINavigationController alloc] initWithRootViewController:homeScreenObject]; 
[homeScreenObject release]; 
[window addSubview:[navController view]]; 
// Override point for customization after application launch 
[window makeKeyAndVisible]; 

navController是在頭文件 的UINavigationController * navController聲明實例變量;

現在您firstviewcontroller創建一個IBAction爲,並與行動結合您的按鈕的向下觸摸事件,並在該方法中使用這些線路

ViewController *ViewControllerObject = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 
[self.navigationController pushViewController:ViewControllerObject animated:YES]; 
[ViewControllerObject release]; 

這樣的viewController應有的tableView和的tableView的委託方法「didSelectRowAtIndexPath方法」使用上面的代碼進一步導航

相關問題