StoryBoard で構成された唯一の TableViewController があります。セグエではなくプログラムで接続する方がよいと判断したので、次のコードを使用して ViewController を表示します。
UIStoryboard *aStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
NewProjectViewController *newProject = [aStoryboard instantiateViewControllerWithIdentifier:@"NewProjectViewController"];
newProject.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:newProject];
[self presentViewController:navController animated:YES completion:nil];
しかし、表示されている ViewController は単純な TableViewController ですが、Storyboard でいくつかのレイアウトを行っています。バグのようです。質問を説明するために、投稿にスクリーンショットを添付しました。
解決済み:
問題は、StoryBoard のデザインを上書きするこれら 2 つの方法にありました。
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
return 0;
}
それらはコメント解除されましたが、UITableViewController の他のメソッドはコメントされました。おそらく、後ですべての UI をプログラムする必要があるでしょう。なぜなら、このソリューションはプロトタイピングのためだけに欲しかったからです。助けてくれてありがとうマコ!