An Exception occured and control going to "bool collideConnected = j->m_collideConnected;" with TouchEvents.

Hello all,

I am doing the raywenderlich’s Break out tutorial at http://www.raywenderlich.com/2010/02/23/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-12/ .

Everything worked fine till I gave touch events to the paddle. An Exception has occurred and control is going to
bool collideConnected = j~~>m_collideConnected; at b2World.cpp
Since UITouch class is not present in cocos2d-x I have to use CCTouch and CCSetIterator for getting the location touched .
The touch Events code is as follows :
//Touch events
void HelloWorld::ccTouchesBegan
{
if
return;
CCSetIterator it;
CCTouch* touch;
CCPoint location;
b2Vec2 locationWorld;
for; it != pTouches~~>end(); it**)
{
touch = ;
if
break;
location = touch~~>locationInView;
location = CCDirector::sharedDirector~~>convertToGL;
locationWorld = b2Vec2;
}

if)
{
b2MouseJointDef md;
md.bodyA = *groundBody;
md.bodyB =*paddleBody;
md.collideConnected = true;
md.maxForce = 1000.0f * *paddleBody->GetMass;
md.target = locationWorld;
*mouseJoint = *world->CreateJoint;
*paddleBody~~>SetAwake;
}
}

void HelloWorld::ccTouchesMoved
{
if
return;
CCSetIterator it;
CCTouch* touch;
CCPoint location;
b2Vec2 locationWorld;
for; it != pTouches~~>end; it**)
{
touch = (CCTouch**);
if
break;
location = touch~~>locationInView;
location = CCDirector::sharedDirector~~>convertToGL;
locationWorld = b2Vec2;
}

*mouseJoint->SetTarget;
}

void HelloWorld::ccTouchesCancelled
{
if
{
*world~~>DestroyJoint;
*mouseJoint = NULL;
}
}

void HelloWorld::ccTouchesEnded
{
if
{
*world~~>DestroyJoint;
*mouseJoint = NULL;
}
}
The variables are

b2Body*paddleBody;
b2Fixture
* *paddleFixture;
//paddle movement
b2MouseJoint**mouseJoint;

Please help me where I am going wrong.