How to delay an action or How to control program flow to wait for a particular action to complete

Continuing the discussion from How can I delay game/code during an action?:

I have code something like this.

I have to move a sprite to particular position and after completion of that action, i want to remove it.

But it is removing it without performing the action. How, to achieve this.
sp is a Sprite
sp->runAction(MoveTo::create(1.0, Vec2(visibleSize.width/2, visibleSize.height/2)));
this->removeChild(sp);

In this case you can simply create sequence. Sth like:

auto seq = Sequence::create(MoveTo::create(1.0f, Vec2(x,y)), RemoveSelf::create(), nullptr);
sp->runAction(seq);