How to change the image of sprite which is created from cocos studio?

I have loaded a sprite from cocos studio,later i want to change its image and i tried different ways found in the internet but i am not able to change the image
here is my code
1st way

 auto rootNode = CSLoader::createNode("QuizScene1.csb");
 option1 = rootNode->getChildByName<cocos2d::Sprite*>("option1");
option1->setTexture("option1_2.png");
this->addChild(rootNode);

2nd way

auto rootNode = CSLoader::createNode("QuizScene1.csb");
option1 = rootNode->getChildByName<cocos2d::Sprite*>("option1");
option1->setTexture(CCTextureCache::sharedTextureCache()->addImage("option1_2.png"));
this->addChild(rootNode);

Thanks

1 Like