2017-05-02 4 views
1

新しいファイルでビューコントローラを作成しましたが、create nibオプションをチェックしても問題ありませんでした。私は素敵なIBレイアウトを作って、物事は素晴らしいです。ファイル所有者は右のViewControllerにリンクされ、ペン先のビューはファイル所有者のビューアウトレットにリンクされます。.nibでビューコントローラをロードしようとして失敗しました。

今、AppDelegateのペンでこのビューコントローラをインスタンス化しようとしています。

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. 
} 
+0

というコードを投稿することはできますか? – user3797599

+0

私はそうしました:) – jbehrens94

+0

私はどこにも見ません[self.window makeKeyAndVisible]; – user3797599

答えて

2

コール[self.window makeKeyAndVisible]。 applicationDidFinishLaunchingで

関連する問題