I have a Storyboard which loads a XIB with a TableView inside.
When the user selects a row from the TableView a new XIB should be loaded with the following method 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];
}
The loaded new XIB should show the following View (with a button inside):
Instead it loads a black view like below:
I checked whether the view is connected to the viewcontroller. From my point of view everything is fine. In IB it the view is connected the File's Owner:
I solved it. All I had to do is to close XCode and reopen the project. After that all worked just fine!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.