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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:06:34+00:00 2026-05-24T05:06:34+00:00

I have this code below. The thing is, each time I click on the

  • 0

I have this code below. The thing is, each time I click on the “SPIN” ccmenuitem, the program crashes with a “Program received signal: SIGABRT”

Here’s the output in the console:

2011-07-29 13:52:52.906 HelloWorld[1031:207] -[NSCFString shuffle]: unrecognized selector sent to instance 0x6833c90
2011-07-29 13:52:52.976 HelloWorld[1031:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString shuffle]: unrecognized selector sent to instance 0x6833c90'

I don’t know what’s wrong, my

And here is my code.

`#import <Foundation/Foundation.h>
#import "cocos2d.h"

@interface GameScene : CCLayer {
    NSMutableArray * answersArray;    //holds all valid answers 
    NSMutableArray * lettersArray;    //holds placement of letters to display
    NSMutableArray * userAnswerArray; //holds user's answer to check and submit
    NSString * THEWORD;               //the word
}

+(id) scene;
....
- (void) spinWord;
- (void) playWord;


@end`

And this implementation:

`

@implementation GameScene

+(id) scene   {   ...    }
-(id) init
{
    if( (self=[super init])) {
         ...//everything is initialized
         [self initImages]
         ...
    }    
}
- (void) initImages
{
    ....
    CCMenuItem *menuItem1 = [CCMenuItemImage itemFromNormalImage:@"PLAYunselected.png" selectedImage:@"PLAYselected.png" target:nil selector:@selector(onPlayWord)];

    CCMenuItem *menuItem2 = [CCMenuItemImage itemFromNormalImage:@"SPINunselected.png" selectedImage:@"SPINselected.png" target:self selector:@selector(spinWord)];

    CCMenu *menu = [CCMenu menuWithItems:menuItem1, menuItem2, nil];
    [menu alignItemsHorizontally];
    menu.position = ccp(72, 198);
    [self addChild:menu z:2];

}
- (void) spinWord{
    //NSLog(@"%@",lettersArray);   <---if I uncomment this line, I get an EXC_BAD_ACCESS message instead
    [lettersArray shuffle];   // <--- this line causes the SIGABRT signal, even if it's initialized.
    NSLog(@"%@",lettersArray);
    ...
}

@end
`

Please help me out. Is this a memory management problem? If so, how do I fix it?

Thank you very much!

  • 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-24T05:06:36+00:00Added an answer on May 24, 2026 at 5:06 am

    That error always means exactly what it reads like it means. You have sent a message to an object that does not understand that message (meaning the object does not have a method to handle such a request). This however can also mean you are sending a message to an object that does not exist.

    If you try to access a bad array index (or the index of an array that does not actually exist) you get bad access. If you try to access a method that does not exist, or a method of an object that does not exist, you get a unrecognized selector message.

    I do not see you allocating or initializing your arrays. I don’t know what shuffle is, you have not posted code for it. It may be a built in method for all I know. I am fairly certain that all you need to do is allocate and initialize your arrays.

    NSMutableArray * answersArray = [[NSMutableArray alloc] init];
    // And so on with your other arrays.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code below. As you can see I am passing two variables
I have this javascript code below that uses jquery, it is suppoed to be
I have a data that looks like this . And my code below simply
Racking my brains on this one. I have the code below: the first stages
I get this error, while I'm testing the code below: You have an error
I have a code like this below, which gives me a $link that equals
Hi I have below pseudo code with throws an exception like this throw new
I have the code below which works fine, steps through the rows pinging each
I have this code in jQuery, that I want to reimplement with the prototype
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:

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.