Q:

Update a sprite's height in cocos2d

I need to scale a sprite's height exactly to a fixed value.  I don't think the function scaleBy() or scaleTo() could help.  Please help me to figure it out. 

A:

Each CCSprite object has properties for the scale, scaleX and scaleY. In your case, you should use the scaleY property and do some simple maths :
sprite.scaleY = DESIRED_HEIGHT/sprite.contentSize.height;

But you have to make sure that your desired height is in float, otherwise you might get some issues, like always having 0 or 1 as a result! 
If you want to animate it, you can also use the CCScaleTo action like this :
float scaleY = DESIRED_HEIGHT/sprite.contentSize.height;
[sprite runAction:[CCScaleTo actionWithDuration:duration scaleX:sprite.scaleX scaleY:scaleY]];

Hope this helps!