using box2d userData in animated spritesheet

using box2d userData in animated spritesheet
0.0 0


As we are using box2d for collision detection in our project. we want to use the following code for the sprite sheet

pSprite1= CCSprite::spriteWithSpriteFrame
> spriteFrameByName);
//pSprite1 = CCSprite::spriteWithFile);// it is working for single sprite but how to work with the sprite sheet
// how we can make a CCRect on the animated spritesheet
b2BodyDef ballBodyDef;
ballBodyDef.userData = pSprite1;

//this is our timer/update function
void InGameLayer::timerFunc

CCLOG ("%ld\n",b->GetPosition().y);
CCSprite *ballData =b~~>GetUserData();

ballData~~>setPosition .x*PTM_RATIO,b~~>GetPosition().y*PTM_RATIO));
// ballData->setRotation(–1*CC_RADIANS_TO_DEGREES(b->GetAngle()));