故事板& 'NSInternalInconsistencyException',原因:

时间:2013-10-10 21:52:53

标签: iphone ios objective-c runtime-error

NSInternalInconsistencyException',原因:'无法在bundle中加载NIB:'NSBundle(已加载)',名称为'DetayViewController''

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    DetayViewController *liste = [[DetayViewController alloc]initWithNibName:@"DetayViewController" bundle:nil];

    if ([[akdeniz objectAtIndex:indexPath.row]isEqualToString:@"Antalya"]) {
        liste.ptrs =0;
        [liste setTitle:[akdeniz objectAtIndex:indexPath.row]];

    }

    if ([[ege objectAtIndex:indexPath.row]isEqualToString:@"Aydın"]) {
        liste.ptrs =1;
        [liste setTitle:[ege objectAtIndex:indexPath.row]];


    [self.navigationController pushViewController:liste animated:YES];
}
}

1 个答案:

答案 0 :(得分:1)

UIStoryboard *storyboard = someViewController.storyboard;
[storyboard instantiateViewControllerWithIdentifier:@"DetayViewController"];

或者如果它是您的第一个视图控制器

storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" /*whatever*/ bundle:nil];