C/C++ Cocos2dx Object return null after calling schedule
<p>I am newbie for Cocos development
Now, I am facing the problem when calling schedule
I have 2 scenes (Scene1 and Scene2) and Object1. 
Scene1 is main, has a menu to change to Scene2.
In createScenes2() function I modify the values of Object1, as below</p>

<pre><code>Chap5.h
Scene *scene1,*scene2;
int ount;
</code></pre>

<p>Chap5.cpp</p>

<pre><code>scene1 = Scene::create();
scene1-&gt;retain();
scene2 = createScene2();
scene2-&gt;retain();
auto nodeItems = Node::create();
nodeItems-&gt;setName("nodeItems");

auto menuNode = Node::create();
menuNode-&gt;setName("menuNode");
int index = 2;

auto thisSceneLabel = Label::createWithTTF("This Is A Scene 1",
        "Marker Felt.ttf", 64);

auto menuItem1 = MenuItemFont::create("Make A New Scene");
menuItem1-&gt;setFontNameObj("Marker Felt.ttf");
menuItem1-&gt;setFontSizeObj(64);  menuItem1-&gt;setName("menuItem1");

menuItem1-&gt;setCallback([&amp;](cocos2d::Ref *sender) {

    Director::getInstance()-&gt;replaceScene(scene2);

    });

auto menu = Menu::create(menuItem1, NULL);
menu-&gt;setName("menu");
menuNode-&gt;addChild(menu, 1);
menu-&gt;setPosition(Vec2::ZERO);

scene1-&gt;addChild(menuNode, 2);
scene1-&gt;setTag(1);


this-&gt;addChild(scene1);

return true;
</code></pre>

<p>In createScenes2() I modified Count value</p>

<pre><code>Scene* Chap5::createScene2() {
 count=999999;
scene2-&gt;schedule(schedule_selector(Chap5::updateCount), 0.5); // call      schedule to updates
</code></pre>

<p>}
but in the method updates, count is not updated </p>

<pre><code>void Chap5::initSprite(float dt) {
CCLOG("count = %d", count);}
</code></pre>

<p>My problem is count not get value after transaction to Scenes2 and call schedule method
Anyboby can let me know why
Thank you so much for your help</p>