2013-05-16 97 views
1

因此,我第一次製作iPad應用程序,現在我有一個視圖控制器,其按鈕顯示在故事板上,一切以及我想要做的事情是當我點擊一個特定的按鈕,它帶我到一個新的屏幕。在故事板/視圖控制器之間切換

所以我創建了第二個屏幕的第二個viewcontroller類,並且我爲按鈕創建了一個IB Action方法,但它是空的,因爲我不知道如何實現它。那麼我需要做些什麼來完成呢?

回答

1

試試吧....

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 
{ 
// iPad-specific interface here 
LBAlertLoginViewController *lbAlertLoginVc = [[LBAlertLoginViewController alloc]initWithNibName:@"LBAlertLoginViewController_iPad" bundle:nil]; 
[self.navigationController pushViewController:lbAlertLoginVc animated:YES]; 
[lbAlertLoginVc release]; 
} 
else 
{ 
// iPhone and iPod touch interface here 
LBAlertLoginViewController *lbAlertLoginVc = [[LBAlertLoginViewController alloc]initWithNibName:@"LBAlertLoginViewController_iPhone" bundle:nil]; 
[self.navigationController pushViewController:lbAlertLoginVc animated:YES]; 
[lbAlertLoginVc release]; 
} 

希望我幫助。

+0

LBAlertLoginViewController未被XCode識別爲有效類型 – user1782677

+0

@ user1782677:這是您的課程名稱,請將其替換爲您自己的導航課程名稱 –

+0

謝謝!現在給它一個鏡頭。 – user1782677

相關問題