How can i load the different xibs for single class depends on current device in iOS?

后端 未结 3 431
情歌与酒
情歌与酒 2021-01-23 05:50

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

3条回答
  •  再見小時候
    2021-01-23 06:16

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

提交回复
热议问题