iOS Developer iOS Developer - 1 month ago 16
iOS Question

iPad view in universal applications

I am doing a universal appellation. It has a table view. If the user clicks a table cell, and the user selected iPad, it must go to another view which is designed for iPad. How can I make it possible? I am doing as follows:

TwitterDetailViewController *detailViewController = [[TwitterDetailViewController alloc] initWithNibName:@"TwitterDetailViewController" bundle:nil];

detailViewController.detaildict= Detaildict;

[self.navigationController pushViewController:detailViewController animated:YES];
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
iPadView *iPadview = [[iPadView alloc] initWithNibName:@"iPadView" bundle:nil];
[self.navigationController pushViewController:iPadview animated:YES];
}

Answer

Just take flag for iphone and ipad. and then

detailViewController.detaildict= Detaildict;

[self.navigationController pushViewController:detailViewController animated:YES];

if("check here with flag") or else  if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad)
{
iPadView *iPadview = [[iPadView alloc]  initWithNibName:@"iPadView" bundle:nil];
[self.navigationController pushViewController:iPadview animated:YES];
}

I hope it will work!!

Comments