title: sprite kit collision detection with child sprite
body: <p>I'm trying to detect collisions between two sprites  but I'm unable to do this with a child sprite.</p>
  
  <pre><code>self.player = [[Player alloc] initWithImageNamed:@"player"];
  self.player.position = CGPointMake(150, 75);
  [self addChild:self.player];
  
        _object = [SKSpriteNode spriteNodeWithImageNamed:@"object"];
        _object.position = CGPointMake(-40, 27);
         [self.player addChild:_object];
  </code></pre>
  
  <p>then I have collision detetion like this</p>
  
  <pre><code>- (void)checkCollisions {
  [self.map enumerateChildNodesWithName:@"enemy"
  usingBlock:^(SKNode *node, BOOL *stop){SKSpriteNode *enemy = (SKSpriteNode *)node;
  if (CGRectIntersectsRect(enemy.frame, _object.frame)) {
  [enemy removeFromParent];
  }
  }]; }
  </code></pre>
  
  <p>*This does not work!!!  but if I use :</p>
  
  <pre><code>CGRectIntersectsRect(enemy.frame, self.player.frame)  
  </code></pre>
  
  <p>I can detect a collision with the main body.  how do I do collision detection for a child of another sprite?</p>