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 8347985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:33:05+00:00 2026-06-09T07:33:05+00:00

Possible Duplicate: Error “No known class method for selector 'Hello:'” in custom-made framework I

  • 0

Possible Duplicate:
Error “No known class method for selector 'Hello:'” in custom-made framework

I am creating a Main menu for my game here
It does not compile but i do not understand why

//  Main Menu.m
//
//
//

#import "MainMenu.h"
#import "CCTouchDispatcher.h"
#import "Instructions.h"

CCSprite *seeker1;
CCSprite *cocosGuy;

@implementation MainMenu


+ (CCScene *) scene
{
    CCScene * scene = [CCScene node]; // scene is an autorelease object
    MainMenu * layer =  [MainMenu node]; // later is an autorelease object
    [scene addChild: layer]; // add layer as a child to scene
    return scene; // return the scene
}

- (id) init
{
    if ( ( self = [super init] ) )
    {
        [ self setUpMenus ];
    }
    return self;
}

- (void) setUpMenus
{

    // create menu items

    CCMenuItemImage * startButton = [CCMenuItemImage itemFromNormalImage:@"startbutton.png"
                                                           selectedImage:@"startbutton_selected.png"
                                                                  target: self
                                                                selector: @selector (doSomethingOne:)];


    CCMenuItemImage * instructionsButton = [CCMenuItemImage itemFromNormalImage:@"instructionsbutton.png"
                                                                  selectedImage:@"instructionbutton_selected.png"
                                                                         target: self
                                                                       selector: @selector(doSomethingTwo:)];


    CCMenuItemImage * unlockList = [CCMenuItemImage itemFromNormalImage: @"unlocklist.png"
                                                          selectedImage:@"unlocklist_selected.png"
                                                                 target: self
                                                               selector: @selector(doSomethingThree:)];

    // create the menu and add the items to it
    CCMenu * myMenu = [CCMenu menuWithItems: startButton, instructionsButton, unlockList,nil];


    // arrange the items vertically
    [myMenu alignItemsVertically];


    // add the menu to the scene
    [self addChild:myMenu];

}


- (void) doSomethingOne: (CCMenuItem *) menuItem
{


}

- (void) doSomethingTwo: (CCMenuItem  *) menuItem
{
    [[CCDirector sharedDirector] replaceScene:
     [CCTransitionFade transitionWithDuration:0.5f scene:[Instructions scene] ]];
}

- (void) doSomethingThree: (CCMenuItem  *) menuItem
{

}


@end

Why do I get the error that there is No known class method for the selector scene? regarding doSomethingTwo.
Do I have to import something in the .h file? or an implementation?
Thank you for any help you can provide me.

  • 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-09T07:33:06+00:00Added an answer on June 9, 2026 at 7:33 am

    Does the Instructions class implement this selector?

    +(id) scene
    {
       id scene = [CCScene node];
       return scene;
    }
    

    And does the Instruction class’ interface declare this selector so other classes can reference it?

    @interface Instructions : CCLayer
    {
    }
    
    +(id) scene;
    
    @end
    

    You need both.

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

Sidebar

Related Questions

Possible Duplicate: Causes of 'java.lang.NoSuchMethodError: main Exception in thread “main”' i got this error
Possible Duplicate: error saying “autocomplete method doesn't exist” with rails3-autocomplete gem I am trying
Possible Duplicate: In jquery: Use attr(“class”) value as a selector? I have fields with
Possible Duplicate: Weird “406 not acceptable” error following code generate a 406 Not Acceptable
Possible Duplicate: “Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given” error while
Possible Duplicate: Eclipse Error: “Failed to connect to remote VM” When I debug my
Possible Duplicate: sem_open() error: “undefined reference to sem_open()” on linux (Ubuntu 10.10) Having issues
Possible Duplicate: g++ “is not a type” error The following does not compile: 1
Possible Duplicate: “Undefined reference to” template class constructor I've just started using templates, and
Possible Duplicate: Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupporte d major.minor version 51.0) i

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.