0

Alright, so what is happening is I have a button setup to link to another view in Xcode, so when the button is pressed, you will be directed to that view. Simple enough? So I thought. I've done this same implementation several times over, but for some reason when I link to the view I'm going to, it just brings me to a blank white screen. Here's the code:

- (IBAction)mainmenu:(id)sender
{
    UIScrollView_PagingViewController *MainMenu = [[UIScrollView_PagingViewController alloc] initWithNibName:nil bundle:nil];
    MainMenu.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentModalViewController:MainMenu animated:YES];
    [UIScrollView_PagingViewController release];
}

Here's my entire project if you'd like to take a look at my XIB files, or my total code (1.4MB): http://www.mediafire.com/?cayw6o35ftcxsah

Jordan Clark
  • 153
  • 1
  • 5
  • 11
  • I realize that I had "MainView" as my view's name in UIScrollView_PagingViewController.xib, but I changed it back to nothing, and it's still not working. – Jordan Clark Apr 24 '12 at 23:50

2 Answers2

0

You're initializing MainMenu (which should be called mainMenu by naming conventions) with a nil NIB name. So if your NIB is not named the same as the view controller it won't find it. To solve this, specify the NIB name you want the view controller to load.

Also, you should be releasing your MainMenu variable, not the class UIScrollView_PagingViewController. So this is also an issue.

Joel
  • 15,654
  • 5
  • 37
  • 60
0

When you allocate your MainView you are using initWithNibName with nil parameter : try either

    UIScrollView_PagingViewController *MainMenu = [[UIScrollView_PagingViewController alloc] initWithNibName:@"UIScrollView_PagingViewController" bundle:nil];

Or simply

    UIScrollView_PagingViewController *MainMenu = [[UIScrollView_PagingViewController alloc] init];

Niko
  • 2,543
  • 1
  • 24
  • 29
  • Calling [[UIScrollView_PagingViewController alloc] init] is the exact same as calling initWithNibName and passing nil, which he is already doing. The controller automatically tries to find the right NIB based on the name. Bad advice. And I'm not sure why you posted the same answer I already posted before that. – Joel Apr 25 '12 at 19:01