Sorry Guys in advance, I know there are already plenty similar questions are available. I tried all solutions but didn't work any of them for me.
I'm Using Xcode 4.5.2 and using two xibs for iphone5/ios6 1> RootViewController5 and for all other devices 2> RootViewController these both nib file has single ViewController named RootViewController.In both the nib file's File owner I have selected RootViewController class in Custom class inspector.
Now in ViewDidLoad method I'm trying to load two nibs like this
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
UIViewController *viewController3;
if(result.height == 480)
{
viewController3 = [[[UIViewController alloc] initWithNibName:@"RootViewController" bundle:nil] autorelease];
}
if(result.height == 568)
{
viewController3 = [[[UIViewController alloc] initWithNibName:@"RootViewController5" bundle:nil] autorelease];
NSLog(@"iphone 5 123");
}
}
I have tried below code as well
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
RootViewController *viewController3;
if(result.height == 480)
{
viewController3 = [[[UIViewController alloc] initWithNibName:@"RootViewController" bundle:nil] autorelease];
}
if(result.height == 568)
{
viewController3 = [[[UIViewController alloc] initWithNibName:@"RootViewController5" bundle:nil] autorelease];
NSLog(@"iphone 5 123");
}
}
But no luck. Please advise where I'm getting it wrong.
Thanks
Mayur