Objective c 在故事板/视图控制器之间切换

Objective c 在故事板/视图控制器之间切换,objective-c,xcode,ipad,mobile,uiviewcontroller,Objective C,Xcode,Ipad,Mobile,Uiviewcontroller,所以我第一次制作一个iPad应用程序,现在我有一个视图控制器,它的按钮显示在故事板上,我想做的是当我点击某个按钮时,它会把我带到一个新的屏幕上 因此,我为第二个屏幕创建了第二个viewcontroller类,并为按钮创建了一个IB操作方法,但它是空的,因为我不知道如何实现它。那么我要怎么做才能做到这一点呢?试试看 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // iPad-specific interface here

所以我第一次制作一个iPad应用程序,现在我有一个视图控制器,它的按钮显示在故事板上,我想做的是当我点击某个按钮时,它会把我带到一个新的屏幕上

因此,我为第二个屏幕创建了第二个viewcontroller类,并为按钮创建了一个IB操作方法,但它是空的,因为我不知道如何实现它。那么我要怎么做才能做到这一点呢?

试试看

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];
}
希望我能帮忙。

试试看

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];
}

希望我能帮上忙。

LBAlertLoginViewController未被XCode识别为有效的type@user1782677:这是您的类名,请将其替换为您自己的导航类名谢谢!立即拍摄。XCode无法将LBAlertLoginViewController识别为有效的type@user1782677:这是您的类名,请将其替换为您自己的导航类名谢谢!现在试一试。