1

所以我第一次制作 iPad 应用程序,现在我有一个视图控制器,它的按钮显示在情节提要和所有内容上,我想做的是当我点击某个按钮时,它会把我带到一个新画面。

所以我为第二个屏幕创建了第二个视图控制器类,并为按钮创建了一个 IB Action 方法,但它是空的,因为我不知道如何实现它。那么我该怎么做才能做到这一点呢?

4

1 回答 1

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

希望我有所帮助。

于 2013-05-16T12:04:49.330 回答