1

次のチュートリアルhttp://www.xcode-tutorials.com/multiview-application/をフォローしようとしています。

しかし、私はに遭遇し続けました

「NIBをバンドルでロードできませんでした:'NSBunde....」

ボタンクリックイベントで失敗しました。以下はボタンクリックイベントのコードです

-(IBAction)swapViews:(id)sender
{
    windowsbasedmultiviewAppDelegate *delegate = (windowsbasedmultiviewAppDelegate *)[[UIApplication sharedApplication] delegate];
    FirstViewController *newView  = [[FirstViewController alloc] initWithNibName:@"FirstViewcController" bundle:nil];
    [delegate switchView:self.view toView:newView.view]; -- It failed here

}

以下はswitchViewのコードです

-(void)switchView:(UIView *)view1 toView:(UIView *)view2{
    [UIView beginAnimations:@"Animation" context:nil];
    [UIView setAnimationDuration:.75];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.window cache:YES];
    [view1 removeFromSuperview];
    [_window addSubview:view2];
    [UIView commitAnimations];

}

Xcode4とIOS4.3を使用しています。どうもありがとうございます

4

1 に答える 1

3

ここでNIBの名前を間違えた可能性があります

initWithNibName:@"FirstViewcController"

おそらくそうあるべきです、

initWithNibName:@"FirstViewController"

追加のに注意してくださいc

于 2011-07-07T04:53:22.017 に答える