Iphone XIB从pushViewController以黑屏加载

Iphone XIB从pushViewController以黑屏加载,iphone,ios,objective-c,xcode,uitableview,Iphone,Ios,Objective C,Xcode,Uitableview,我有一个故事板,它加载了一个包含TableView的XIB 当用户从TableView中选择一行时,应使用以下方法加载新的XIB pushViewController: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here. Create and push another view cont

我有一个故事板,它加载了一个包含TableView的XIB

当用户从TableView中选择一行时,应使用以下方法加载新的XIB pushViewController:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    RecipeDetailViewController *recipeDetailViewController = [[RecipeDetailViewController alloc] init];
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    NSString *str = cell.textLabel.text;
    recipeDetailViewController.navTitle = str;

    // Pass the selected object to the new view controller.
    [self.navigationController pushViewController:recipeDetailViewController animated:YES];

}
加载的新XIB应显示以下视图(内部有一个按钮):

而是加载一个黑色视图,如下所示:

我检查了视图是否连接到viewcontroller。在我看来,一切都很好。在IB it中,视图连接到文件的所有者:


我解决了它。我所要做的就是关闭XCode并重新打开项目。在那之后一切都很好