新的UIViewController是空白的?

时间:2011-09-20 21:31:30

标签: ios xib

我已经设置了一个名为NextViewController的.xib文件。我试图用这段代码显示它:

NextLevelController *myNextLevelController = [[NextLevelController alloc] initWithNibName:@"NextLevelController" bundle:nil];            
[self presentModalViewController:myNextLevelController animated:YES];

但是,它显示为空白显示。我有输入文字的标签和按钮。我究竟做错了什么?

1 个答案:

答案 0 :(得分:2)

NextLevelController *myNextLevelController = [[NextLevelController alloc] initWithNibName:@"NextViewController" bundle:nil];            
[self presentModalViewController:myNextLevelController animated:YES];

您在代码中使用了错误的xib名称。我已经修好了