Hi guys,
I create a game, ios and android work both fine, so I decide to convert to wp8, the strange thing is THESE code always crush in emulator.
for (b2Body* b = world->GetBodyList(); b; b = b->GetNext())
{
if (b && b->GetUserData() != NULL)
{
CCSprite *spr = (CCSprite*)b->GetUserData();
if (spr != NULL) {
if (spr->getPosition().x < -spr->getContentSize().width)
{
world->DestroyBody(b);
// remove self
spr->removeFromParentAndCleanup(true);
}
}
}
When I want to loop all the b2Body in the world, always get NULL ‘b’, but it works fine in iOS and android. Does any body have the same problems?