2011-11-23 56 views
0

我开始使用iOS编程,并在XCode 4.2.1中创建了一个新项目。但是,我没有按照预期在我的项目中看到.xib文件。我尝试添加一个新的.xib文件并在其上构建界面,但是当我运行我的程序时,我在iPad模拟器上看到一个空白的白色屏幕。我错过了什么吗?谢谢。没有用iOS项目创建的用户界面文件

回答

0

您可以从模板替换的appDelegate这种方法(和厦门国际银行的名称/如果需要剔除的代码通用方面)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 
    // Override point for customization after application launch. 
    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]; 
    } 
    self.window.rootViewController = self.viewController; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 

选择的单一视图的应用你在创建新应用程序时提供

+0

我选择了单个视图应用程序,但仍未看到.xib文件。 – rookieRailer

+0

实际上,在我的xcode版本中,而不是.xib r .nib文件中,有一个故事板文件,它具有界面生成器。所以我的问题是固定的,谢谢。 – rookieRailer