ios xib适配iPhone,iPad语句

来源:互联网 发布:蛙趣软件下载 编辑:程序博客网 时间:2024/05/16 14:41

    self.window = [[[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]] autorelease];

    // Override point for customization after application launch.

    if ([[UIDevicecurrentDevice] userInterfaceIdiom] ==UIUserInterfaceIdiomPhone) {

        self.viewController = [[[ViewControlleralloc] initWithNibName:@"ViewController_iPhone"bundle:nil]autorelease];

    } else {

        self.viewController = [[[ViewControlleralloc] initWithNibName:@"ViewController_iPad"bundle:nil]autorelease];

    }

0 0