title: sprite kit - objective c: slow fps when I create a lot nodes
body: <p>I wanted to create a space background so I make a for loop to create the stars. Here is the code: </p>
  
  <pre><code>for (int i = 0; i&lt;100; i++) {
  SKShapeNode *star= [SKShapeNode shapeNodeWithPath:Path.CGPath];
      star.fillColor = [UIColor whiteColor];
      star.physicsBody = nil;
      int xposition = arc4random()%960;
      int yposition = arc4random()%640;
      star.position = CGPointMake(xposition, yposition);
      float size = (arc4random()%3 + 1)/10.0;
      star.xScale = size;
      star.yScale = size;
      star.alpha = (arc4random()%10 + 1 )/ 10.0;
      star.zPosition = -2;
       [self addChild:star];
  }
  </code></pre>
  
  <p>But it takes a lot from my cpu. when the code is activated the cpu at top 78%.(I check the code in the iPhone simulator);</p>
  
  <p><img src="https://i.stack.imgur.com/HlQ7a.png" alt="enter image description here"></p>
  
  <p>Somebody know how to fix it? thanks.</p>