user1782677
user1782677

Reputation: 2007

Switching between storyboards/view controllers

So I'm making an iPad app for the very first time and right now I have one view controller with its buttons displayed on the storyboard and everything and what I want to do is when I click on a certain button, it brings me to a new screen.

So I created a second viewcontroller class for the second screen and I created an IB Action method for the button but it's empty because I don't know how to implement it. So what do I have to do to accomplish this?

Upvotes: 1

Views: 321

Answers (1)

Chirag Pipaliya
Chirag Pipaliya

Reputation: 1281

Try it....

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

Hope i helped.

Upvotes: 1

Related Questions