Problem with static body

I am working on a small game that allows you to shoot a ball in a certain direction. The ball has to collide with a static body, and it does it just seems like the static body is trying to hide. The UIView shows up where I have placed it, but when I shoot the ball in that direction it collides with something invisible. Have I set the position using a wrong method?

Code: Select all

-(void)createBoxWithView:(UIView *)physicalView{

   
    b2BodyDef bd;
    bd.type = b2_staticBody;
    bd.userData = (__bridge void*)physicalView;
   
    CGPoint center = [physicalView center];
   
    bd.position.Set(center.x/PTM_RATIO, (self.view.frame.size.width - center.y)/PTM_RATIO);
   
    b2Body *body = world->CreateBody(&bd);
   
    b2PolygonShape box;
    box.SetAsBox(10/PTM_RATIO, 10/PTM_RATIO);
   
    b2FixtureDef fd;
    fd.shape = &box;
   
    body->SetType(b2_staticBody);
   
    body->CreateFixture(&fd);
   
}


Help much appreciated!
Thanks!
The position you have set is correct but the execution can be different from this. It is because the compilation could not be possible as it will show some error. You have to rectify that and then do the procedure again. Apple iPad support is there if need any help.
Did u use a spy apps on Android for monitro somebody? Can u tell me how It is work?

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