cocos2D v2.x中有带参数的回调block:
id blk = [CCCallBlockN actionWithBlock:^(CCNode *node){ node.position = orign; }];
不过到了cocos2D v3.x中只有CCActionCallBlock一种block回调了,如果需要像以前那样传递参数,可以通过局部外围变量的方法,如下:
CCNode *node = myNode; id blk = [CCActionCallBlock actionWithBlock:^{ node.position = origin; }]; [node runAction:blk];