I'm throwing a lot of objects across the screen (1 beachball every 0.1s) and swiping them toward a box, the balls are recycled after they leave the screen or hit the ball. The problem i encountered is that when multiple balls hit the box, frame rates drop drastically. I'm not sure what's making this happen. Is there a better way to do the following so that it doesn't lag? I use the default cocos library to play sounds.
-(void)ccPhysicsCollisionPostSolve:(CCPhysicsCollisionPair *)pair can:(CCNode *)nodeA wildcard:(CCNode *)nodeB {
if([nodeB.physicsBody.collisionType isEqualToString:@"hit"]){
[[_physicsNode space] addPostStepBlock:^{
[self remove:nodeA];
} key:nodeB];
}else if([nodeB.physicsBody.collisionType isEqualToString:@"floor"]){
[[_physicsNode space] addPostStepBlock:^{
[self remove:nodeA];
} key:nodeB];
}else {
[self playSound:@"collide.mp3" bg:YES];
}
}