XCode链接到故事板

时间:2015-04-23 14:38:39

标签: ios objective-c xcode

我有一个XIB文件,我希望如此:

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

 switch (indexPath.row)
        {

            case 0:
                LHPurchaseOrder *purchaseOrderController = [[LHPurchaseOrder alloc]initWithNibName:@"LHPurchaseOrder" bundle:nil];
                purchaseOrderController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
                [self presentViewController:purchaseOrderController animated:YES completion:nil];
                break;
        }


}

现在我需要使用拆分视图控制器(显然你只能在故事板中使用)所以我为这个视图创建了一个故事板。现在我需要知道如何将它从我的表视图链接到storyboard而不是我的XIB文件。这可能吗?我查看了Storyboard Segue Tutorial,但我发现它令人困惑,我认为它不是我想要的。任何帮助,将不胜感激。

1 个答案:

答案 0 :(得分:0)

LHPurchaseOrder *vc= [[UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil] instantiateViewControllerWithIdentifier:@"LHPurchaseOrder"];

[self.navigationController pushViewController:vc animated:YES];
相关问题