尝试使用 .nib 加载视图控制器失败

Trying to load view controller with .nib fails

我已经通过新文件创建了一个视图控制器,我检查了创建 nib 选项,一切正常。我做了一个漂亮的 IB 布局,一切都很棒。文件所有者链接到右边ViewController,nib中的视图链接到文件所有者中的视图插座

现在,我尝试用 AppDelegate 中的 nib 实例化这个视图控制器。

TerminationViewController *terminatedVC = [[TerminationViewController alloc] initWithNibName:@"TerminationViewController" bundle:nil];
terminatedVC.view.hidden = NO;
[self.window.rootViewController presentViewController:terminatedVC animated:YES completion:nil];

没有错误,我看到黑屏。我究竟做错了什么?我还检查了笔尖的目标成员资格。

编辑

self.window = [[[InterceptorWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.window.backgroundColor = [UIColor whiteColor];

TerminationViewController *terminatedVC = [[TerminationViewController alloc] initWithNibName:@"TerminationViewController" bundle:nil];
terminatedVC.view.hidden = NO;
[self.window.rootViewController presentViewController:terminatedVC animated:YES completion:nil];

// Wait for 10 seconds
double delayInSeconds = 10.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
    // Do something, next view controller.
}

调用[self.window makeKeyAndVisible];在 applicationDidFinishLaunching