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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:47:32+00:00 2026-05-30T00:47:32+00:00

There are no errors or warning but this crashes when I try and switch

  • 0

There are no errors or warning but this crashes when I try and switch to the view:

#import "Level1.h"
#import "LevelSelect.h"
#import "GameOver.h"



enum {

kTagPlayer, kTagComputer
};



@implementation Level1



+(id) scene {

CCScene *scene = [CCScene node];

Level1 *layer = [Level1 node];

[scene addChild: layer];

return scene;
}

-(id) init {
if( (self=[super init] )) {

CCSprite *player = [CCSprite spriteWithFile:@"Icon_Small_50.png"];
player.position = ccp(60, 60);
[self addChild:player z:2 tag:kTagPlayer];

CCSprite *computer = [CCSprite spriteWithFile:@"Icon_Small.png"];
computer.position = ccp(440, 160);
[self addChild:computer z:1 tag:kTagComputer];



[computer runAction:[CCMoveTo actionWithDuration:3.0
                                        position:ccp(player.position.x,   player.position.y)]];



self.isTouchEnabled = YES;



[self schedule:@selector(SpritesDidColide) 
      interval:.01];

}
return self;
}



-(void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

UITouch *myTouch = [touches anyObject];
CGPoint point = [myTouch locationInView:[myTouch view]];
point = [[CCDirector sharedDirector] convertToGL:point];

CCNode *player = [self getChildByTag:kTagPlayer];
[player setPosition:point];

CCNode *computer = [self getChildByTag:kTagComputer];
[computer runAction:[CCMoveTo actionWithDuration:3.0
                                    position:ccp(player.position.x, player.position.y)]];


}
-(void) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

UITouch *myTouch = [touches anyObject];
CGPoint point = [myTouch locationInView:[myTouch view]];
point = [[CCDirector sharedDirector] convertToGL:point];

CCNode *player = [self getChildByTag:kTagPlayer];
[player setPosition:point];

CCNode *computer = [self getChildByTag:kTagComputer];
[computer runAction:[CCMoveTo actionWithDuration:3.0
                                    position:ccp(player.position.x, player.position.y)]];

}



-(void) SpritesDidCollide {

CCNode *player = [self getChildByTag:kTagPlayer];
CCNode *computer = [self getChildByTag:kTagComputer];

float xDif = computer.position.x - player.position.x;
float yDif = computer.position.y - player.position.y;
float distance = sqrt(xDif * xDif + yDif * yDif);

if (distance < 45) {
[self unschedule:@selector(SpritesDidCollide)];
[[CCDirector sharedDirector] replaceScene:[CCTransitionScene transitionWithDuration:1        scene:[GameOver node]]];
}

}



@end

And here is what displays in the Console:

* Assertion failure in -[CCTimer initWithTarget:selector:interval:], /Users/GLaDOS/Documents/Xcode 4 Projects/2DPlatformer/2DPlatformer/libs/cocos2d/CCScheduler.m:110
2012-02-17 19:13:07.460 2DPlatformer[709:707]
Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Signature not found for selector – does it have the following form? -(void) name: (ccTime) dt’
*
* First throw call stack:
(0x37f1d8bf 0x31a031e5 0x37f1d7b9 0x31e1c3b3 0x46565 0x4843f 0x3402d 0x948d3 0x32249 0x93a23 0x37f20814 0x37e7b7e1 0x2de31 0x2bdc9 0x37e77435 0x7087f 0x71019 0x727ff 0x352ef50f 0x352eef01 0x352d54ed 0x352d4d2d 0x379f2df3 0x37ef1553 0x37ef14f5 0x37ef0343 0x37e734dd 0x37e733a5 0x379f1fcd 0x35303743 0x912c7 0x2300)
terminate called throwing an exceptionkill
Current language: auto; currently objective-c
quit
Program ended with exit code: 0

  • 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-30T00:47:34+00:00Added an answer on May 30, 2026 at 12:47 am

    I believe the schedule method will trigger a call back to a selector of the form:

    -(void) SpritesDidCollide:(ccTime) dt{
        //  do your thing here. 
    }
    

    and change the selector to

    [self schedule:@selector(SpritesDidCollide:) interval:.01];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There have been a few threads on this topic but none have been able
After I uploaded my files this kind of error is occurred. But there is
Is there a comprehensive list of error/warning messages for the g++ compiler available online?
Is there any way to throw errors or warnings in a KornShell (ksh) script
I get errors when viewing forms and there are not any. I can close
Is there a good way to debug errors in the Visual Studio Designer? In
Is there a description of the various errors that NSXMLParser can return? I'm aware
Is there a common standard for reporting errors in your class functions? I've seen
Is there a project that can log errors in requests to Django on Google
Is there a way to make psycopg and postgres deal with errors without having

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.