I have the complete code in view controller. So, i need to display the same output in iPad,iPhone and iPod. So, am using single view controller for processing data.For this pur
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
}
else
{
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
[UIDevice currentDevice]
will give you the details about the current device. use this in a if loop and select the xib for iphone or i pad.
if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
{
load 1 xib
}
else
{
load another
}
This is very simple when you create a universal app, itself it will give the code check the device type and load particular xib.
for example
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}