title: Spritekit bodyWithbodies does not work
body: <p>I want my <code>spritenode</code> to have multiple <code>physicbodies</code>. I used <code>bodyWithbodies</code> and added the <code>phyisicbodies</code>. But no collision is detected.</p>
  
  <p>Below the method for creating the <code>spritenode</code> which should have more <code>physicbodies</code>.</p>
  
  <pre><code>-(void)spawnBrick
  {
      SKPhysicsBody *brickLeftEdge = [SKPhysicsBody bodyWithEdgeFromPoint:CGPointMake(brick.size.width - brick.size.width, brick.size.height - brick.size.height) toPoint:CGPointMake(brick.size.width - brick.size.width, brick.size.height)];
      brickLeftEdge.categoryBitMask = brickLeftEdgeCategory;
      brickLeftEdge.contactTestBitMask = leftEdgeCategory;
  
  SKPhysicsBody *brickRightEdge = [SKPhysicsBody bodyWithEdgeFromPoint:CGPointMake(brick.size.width, brick.size.height - brick.size.height) toPoint:CGPointMake(brick.size.width, brick.size.height)];
  brickRightEdge.categoryBitMask = brickRightEdgeCategory;
  brickRightEdge.contactTestBitMask = rightEdgeCategory;
  
  brick = [[BrickNodeOne alloc] init];
  brick.name = @"Brick";
  
  NSArray *array = [self objectForKeyedSubscript:@"Brick"];
  BrickNodeOne *oldBrick;
  if ([array count] &gt; 0) {
      oldBrick = [array objectAtIndex:([array count]-1)];
  }
  brick.position = CGPointMake(brick.size.width / 2, (brick.size.height + oldBrick.position.y)-15);
  brick.physicsBody = [SKPhysicsBody bodyWithBodies:@[brickLeftEdge, brickRightEdge]];
  
      brick.physicsBody.collisionBitMask = 0;
      [self addChild:brick];
  }
  </code></pre>
  
  <p>In <code>DidMoveToView</code> I declared the left and right edge of the screen for collision detection with the <code>spritenode</code></p>
  
  <pre><code>    // setup edges
  _leftEdge = [[SKNode alloc] init];
  // heigt + 1000 = for spawned objects above screen
  _leftEdge.physicsBody = [SKPhysicsBody bodyWithEdgeFromPoint:CGPointMake(0.0, 0.0) toPoint:CGPointMake(0.0, self.size.height + 1000)];
  _leftEdge.physicsBody.dynamic = NO;
  _leftEdge.physicsBody.categoryBitMask = leftEdgeCategory;
  _leftEdge.physicsBody.contactTestBitMask = brickLeftEdgeCategory;
  _leftEdge.position = CGPointZero;
  [self addChild:_leftEdge];
  
  _rightEdge = [[SKNode alloc] init];
  // heigt + 1000 = for spawned objects above screen
  _rightEdge.physicsBody = [SKPhysicsBody bodyWithEdgeFromPoint:CGPointMake(self.size.width, 0.0) toPoint:CGPointMake(self.size.width, self.size.height + 1000)];
  _rightEdge.physicsBody.dynamic = NO;
  _rightEdge.physicsBody.categoryBitMask = rightEdgeCategory;
  _rightEdge.physicsBody.contactTestBitMask = brickRightEdgeCategory;
  [self addChild:_rightEdge];
  </code></pre>
  
  <p>The following code contains the bitmask information:</p>
  
  <p>I declared <code>SKPhysicsContactDelegate</code> in the header file. Set the delegate in <code>didMoveToView</code></p>
  
  <pre><code>static const uint32_t leftEdgeCategory          = 0x1 &lt;&lt; 0;
  static const uint32_t rightEdgeCategory         = 0x1 &lt;&lt; 1;
  static const uint32_t brickLeftEdgeCategory     = 0x1 &lt;&lt; 2;
  static const uint32_t brickRightEdgeCategory    = 0x1 &lt;&lt; 3;
  static const uint32_t kCarCategory              = 0x1 &lt;&lt; 4;
  </code></pre>
  
  <p><strong>Information for comment</strong></p>
  
  <p>So I changed the <code>physicsbody</code> from edge to rectangle, unfortunately no contact was detected. </p>
  
  <pre><code>SKPhysicsBody *brickLeftEdge = [SKPhysicsBody bodyWithRectangleOfSize:CGSizeMake(40, brick.size.height) center:CGPointMake((brick.size.width - brick.size.width) + 20 , self.size.height / 2)];
  brickLeftEdge.categoryBitMask = brickLeftEdgeCategory;
  brickLeftEdge.contactTestBitMask = leftEdgeCategory;
  
  SKPhysicsBody *brickRightEdge = [SKPhysicsBody bodyWithRectangleOfSize:CGSizeMake(40, brick.size.height) center:CGPointMake(brick.size.width - 20, brick.size.height / 2)];
  brickRightEdge.categoryBitMask = brickRightEdgeCategory;
  brickRightEdge.contactTestBitMask = rightEdgeCategory;
  </code></pre>