A problem , do me a favor ~~

Description: ` LabelTTF *label = LabelTTF::create(“show next scene”, “Courier”, 36);
    
    addChild(label);
    
    label->setPosition(visibleSize.width/2,visibleSize.height/2);
    
    
    //1 set listener
    EventListenerTouchOneByOne *listener =EventListenerTouchOneByOne::create();
    
    //2 set event
    listener->onTouchBegan = [label](Touch *tt,Event *e){
    
        if(label->getBoundingBox().containsPoint(tt->getLocation())){
            log("if is here ");
            //Director::getInstance()->replaceScene(TransitionFadeBL::create(1,ImageScene::createScene() ));
            
            
        }else{
            log(“else is here”);
            
        }
    
        return  false;
    };
    
    //3 listen the event
    Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener, label);

`
when I run it , and click the label , what showed in console is : else is here … no matter what I do ,the block in if can’t be executed …
I 've already rebuilt , clean ,and restart xcode .
cocos2d-x version: 3.0

do me a favor ~~

You need to post what was on the listener->onTouchBegan = label{ line, because I have a feeling what got link-ified is where your bug is.

Highlight your code and click the </> button

Thanks for ur reply , the problem still exists . but when I replace LabelTTF to Label ,which is recommended in higher version .it works well . anyway ,might cause LabelTTF is obselete .again ,thank you ~

Are you using CPP? I never saw this sintax before ‘-’;

yeah, cpp , I am used to that .

I don’t know if

listener->onTouchBegan = label{  

this is correct. Have you tried to use CC_CALLBACK and put it in a function?