开发者

Error in MultiView Window Based app

开发者 https://www.devze.com 2023-03-18 18:59 出处:网络
I\'m trying to followng the following tutorial http://www.xcode-tutorials.com/multiview-application/ but I kept running into a

I'm trying to followng the following tutorial http://www.xcode-tutorials.com/multiview-application/

but I kept running into a

"Could not load NIB in bundle: 'NSBunde...."

It failed in the button click event and the following is the code for the button click event

-(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

}

The following is the code for the 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];

}

I'm using Xcode4 and IOS 4.3. Thank you very much


You might've gotten the NIB name wrong here

initWithNibName:@"FirstViewcController"

Probably it should be,

initWithNibName:@"FirstViewController"

Note the additional c.

0

精彩评论

暂无评论...
验证码 换一张
取 消