Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8044933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:23:21+00:00 2026-06-05T05:23:21+00:00

I created a game in Xcode and now I decided to add a menu

  • 0

I created a game in Xcode and now I decided to add a menu to it, the menu is the first loading view so I changed

self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];

to:

self.viewController = [[[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:nil] autorelease];

now the view where my game is, is: ViewController.m and from the menu I go there with:

-(IBAction)gogame:(id)sender {
UIViewController *Game = [[UIViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:Game animated:YES];}

Because I needed to give the ViewController.m a name I changed in .h and .m:

@interface ViewController to @interface GameViewController in .h

and @implementation ViewController to @implementation GameViewController in .m

Now I made the button in menu “gogame” run it, and when I click the button it goes from the menu to a black screen, it doesn’t crash or anything It only shows the status bar and a black screen. the only issue that xCode gives me is in app delegate: incompatible pointer types assigning to ‘GameViewController *’ from ‘MenuViewController *’.

I do not know why this is not working And I hope someone could exlain me and tell me how to solve this. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:23:22+00:00Added an answer on June 5, 2026 at 5:23 am

    UIViewController alone is nothing useful, it’s provided to have behavior added to, so in your method:

    Here’s your version of this method:

    -(IBAction)gogame:(id)sender {
        UIViewController *Game = [[UIViewController alloc] initWithNibName:nil bundle:nil];
        [self presentModalViewController:Game animated:YES];
    }
    

    and it is doing exactly what you are telling it to, present a framework provided UIViewController. You haven’t added any extra behavior or a custom view.

    I’m having trouble totally interpreting your current code setup, but it sounds like your new class GameViewController is what you want to show, so change it to:

    -(IBAction)gogame:(id)sender {
        GameViewController *Game = [[[GameViewController alloc] initWithNibName:@"GameViewController" bundle:nil] autorelease];
        [self presentModalViewController:Game animated:YES];
    }
    

    Based on your renaming/refactoring of the class name, I wasn’t sure what the name of your xib file for the controller is. Is it the original “ViewController” or did you also update that to “GameViewController” (like you should)?

    Regarding the warning, where are you creating and assigning a GameViewController?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We've created a simple game as an iframe application for facebook and we now
I'm working up a game in XCode, and I want to add a helper
I have created a small game in Java and I would like to add
I have created a backgammon game in c++ that is played in console. Now
I've created an iPad game using the Universal App Xcode template. Since I'm in
So created a Sprite to which I add other Sprites which are game tiles.
I'm new to Objective C and XCode, currently working on my first iPhone Game.
I'm working on an iPhone game. In iTunesConnect I created Game Center leaderboards for
Im compiling a game created with lib cocos2d-x and running in eclipse + linux.
I've created a game which gives a score at the end of the game,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.