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

  • Home
  • SEARCH
  • 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 7640729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:44:35+00:00 2026-05-31T08:44:35+00:00

I know this is a very beginner question, but I’ve been struggling to figure

  • 0

I know this is a very beginner question, but I’ve been struggling to figure it out.

I’m trying to build an iOS game (using cocos2d) and so I have 2 sets of files

GameScene.h and gameScene.m
MainMenu1.h and MainMenu1.m

GameScene has the sharedcode I’ve leaned to put in.

I call my MainMenu1 – the user chooses how many players from a MenuItemwithImage and that calls ChoosePlayers

I can figure out which menu item was touched, but I need to pass the number of players back to GameScene

in GameScene I put in

-(void) setPlayers (nsinteger*) players
{
totalplayers = players;
}

so in mainmenu1 chooseplayers i did

[[GameScene SharedGameData] setPlayers : 2];

but that doesn’t work.

I’m sorry, I don’t have the code in front of me (not until tonight); i’ve been searching for hours and can’t figure it out.

  • 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-05-31T08:44:36+00:00Added an answer on May 31, 2026 at 8:44 am

    Your method format is incorrect. It should be:

    -(void)setPlayers:(NSInteger)players;
    

    NSInteger is not a pointer either.

    To pass multiplie values, you coud either pass in an array, or:

    -(void)setPlayers:(NSInteger)firstValue withSecondValue:(NSInteger)secondValue; and when you want to call it, it would look like this:

    [[GameScene SharedGameData] setPlayers:2 withSecondValue:4];

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

Sidebar

Related Questions

i know this question was asked before but i have this very weird beginner
this is a very beginner question but I don't know javascript, I only wants
I know my question is very simple, I am trying to work out this
This seems like a very beginner question, but I don't know the answer. Suppose
I know this is a very beginner question, but I'm obviously a beginner. I
I know this question is probably very basic, but I am a beginner so
I know this is a very broadly scoped question, but what do I need
guys I know this question is very basic but I've met in few publications
Ok, I know this is a very basic question, but my head is swimming
I know this is probably a very beginner question that I just can't seem

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.