How to throw b2body using ApplyForce();

I have a _ballBody b2body and i've to apply force to it and throw it in a particular direction.

the statements i am using are in cctouchesended:

UITouch *myTouch = [touches anyObject];
CGPoint location = [myTouch locationInView:[myTouch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
b2Vec2 locationWorld = b2Vec2(location.x/PTM_RATIO, location.y/PTM_RATIO);
_ballBody->ApplyForce(locationWorld, ballBodyDef.position);



I want to know where i am doing the mistake and what would be the solution???
Please help me out in this along with the gravity part.
if you want trow your body use an impulse, because the force will be constantly added, the impulse only one time
Thanks for your reply......

Could you please where i should use that statement in my code...
Quote:
Could you please where i should use that statement in my code...

Just replace 'ApplyForce' with 'ApplyImpulse'. (This is assuming that 'locationWorld' is computed in a sensible way, and can reasonably be used as an impulse vector.)
Am doing the same thing, still my body object is not taking any Action.
The locationWorld is computed as follows:

UITouch *myTouch = [touches anyObject];
CGPoint location = [myTouch locationInView:[myTouch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
b2Vec2 locationWorld = b2Vec2(location.x/PTM_RATIO, location.y/PTM_RATIO);


_ballbody-> ApplyImpulse(locationWorld,_ballBody->GetWorldCenter())
What is the magnitude of locationWorld, and what is the mass of the body to which it's being applied? Keep in mind that if the magnitude of the impulse vector is too low relative to the body's mass, you may not observe any noticeable effect. (And again, I'm assuming that in your simulation it makes sense for a world location - that is, a point - to serve as an impulse vector.)

Original thread: https://box2d.org/forum/viewtopic.php?t=4709