在bundle中创建nib

时间:2012-10-31 10:02:08

标签: objective-c ios xcode

我是ios的新手,无法完成非常简单的事情。

TableViewController *tableVC = [[TableViewController alloc] initWithNibName:@"TableView" bundle:nil andType:CONTROLLER_TYPE_FIRST];
ViewController *wizard = [[ViewController alloc] initWithNibName:@"WizardView" bundle:nil andtype:first];
UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:wizard];

使用tableVC初始化,正常工作。但如果我用向导初始化我得

'Could not load NIB in bundle: 'NSBundle </Users/Mac/Library/Application Support/iPhone Simulator/6.0/Applications/60750878-E595-4A24-B0B8-F65DA78128C0/kodinisRaktas.app> (loaded)' with name 'WizardView''

如何处理此捆绑笔以使其正常工作?

1 个答案:

答案 0 :(得分:0)

例:

  1. ViewController doesnot have .xib
  2. ViewController does have .xib but its name is not 'WizardView'
  3. 解决方案:

    案例1:

     ViewController *wizard = [[ViewController alloc] init];
    

    案例2:

    use correct name of .xib file