Here Lets have a look creating world in box2D.
Every Box2D program begins with the creation of a b2World object. b2World is the physics hub that
manages memory, objects, and simulation. You can allocate the physics world on the stack, heap, or
in Header file Create an object for World like this,
in .mm file create the world
first we have to create gravity.
b2Vec2 gravity = new b2Vec2(0.0f,-10.0f);
and set the sleep parameter for world
bool doSleep = true;
Now , lets create world object
myWorld = new b2World(gravity,doSleep);
when your app exits you have to destroy the world what you have created
In next ,lets add some stuff into world