Tuesday, July 5, 2011

iPhone iPad : check the current device and set the nib manually.

ActiveJobDetail *objActiveDetail;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200    
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
objActiveDetail = [[ActiveJobDetail alloc]initWithNibName:@"ActiveJobDetail-iPad" bundle:nil];
}
else 
#endif
{
objActiveDetail = [[ActiveJobDetail alloc]initWithNibName:@"ActiveJobDetail" bundle:nil];
}


//ActiveJobDetail *objActiveDetail = [[ActiveJobDetail alloc]initWithNibName:@"ActiveJobDetail" bundle:nil];
[self.navigationController pushViewController:objActiveDetail animated:YES];
[objActiveDetail release];

No comments:

Post a Comment