2012-05-08 28 views

回答

6

首先,通過右鍵點擊文件和組部分,然後點擊「新文件」選項,並將其命名爲SecondViewController添加新的UIViewController到您的應用程序。

確保您通過選擇「用XIB1用戶界面」添加XIB選項在創建SecondViewController

假設你要推按鈕單擊新視圖,然後添加一個按鈕,你FirstViewController並添加其按鈕的TouchUpInside事件下面的代碼:

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

如果你正在使用ARC然後取出[secondView release];

讓我知道你是否需要更多幫助。

希望這會有所幫助。

1
FileName *file=[[FileName alloc] initWithNibName:@"FileName.xib" bundle:nil]; 
[self.navigationController pushViewController:file animated:YES]; 
[file release]; 
相關問題