cocos2d中的场景改变崩溃

时间:2014-06-01 21:40:08

标签: cocos2d-iphone

我在尝试按下按钮并进入下一个场景时遇到问题。我收到了SIGABRT错误。我不知道问题是什么:

[...]
    //Play Button
    CCMenuItem *playbutton;
    playbutton = [CCMenuItemFont itemWithString:@"Play" target:self selector:@selector(playButtonMeathod:)];

    CMenu *menu = [CCMenu menuWithItems:itemAchievement,playbutton,itemLeaderboard, nil];

    [menu alignItemsHorizontallyWithPadding:20];
    [menu setPosition:ccp( size.width/2, size.height/2 - 50)];

    // Add the menu to the layer
    [self addChild:menu];

    -(void)playButtonMeathod{
    // Create a scene transition that uses the "RotoZoom" effect

    CCTransitionRotoZoom *transition = [CCTransitionRotoZoom transitionWithDuration:1.0 scene:[Level_1 scene]];



    // Tell the director to run the transition

    [[CCDirector sharedDirector] replaceScene:transition];

[...]

1 个答案:

答案 0 :(得分:-1)

一个问题可能是CCMenuItemFont选择器目标中的方法签名不正确。尝试:

CCMenuItemFont *playbutton = [CCMenuItemFont itemWithString:@"Play" target:self selector:@selector(playButtonMeathod)];