title: didBeginContact not being called after xcode 6
body: <p>I've been having problems with xcode in general. Example, NSLog not printing, case statements not working, etc. I did created this project before xcode 6 came out and thought if i switched it to a new file made in xcode 6 that these things would have been fixed. So far, they have been fixed. However, more problems have happened. One major one is that the didBeginContact method is not being called now. I've tried doing everything to fix it. I changed the category masks, their values, the collisionBitMask, contactBitMask, put different foundations in, but nothing has worked yet. It works in the file made before xcode 6 came out, but not in xcode 6. </p>
  
  <p>There is supposed to be contact detected between the player and the opponent, but it doesn't work anymore.
  I put breakpoints at the didBeginContact method and at the method it is supposed to call when there is contact between the player and opponent, but program didn't exit.</p>
  
  <p>Thanks in advance!</p>
  
  <p>GameScene.m:</p>
  
  <pre><code>#import "GameScene.h"
  
  @interface GameScene ()
  
  
  @end
  
  
  @implementation GameScene
  
  - (void)didMoveToView:(SKView *)view
  {
      if (!self.contentCreated)
      {
          [self createSceneContents];
          self.contentCreated = YES;
  
          [self addplatform];
          [self addPlayer];
          [self addButtons];
          [self addOpponent];
  
      }
  }
  
  typedef NS_OPTIONS(uint32_t, CollisionCategory) {
      CollisionCategoryPlayer     = 1 &lt;&lt; 0,
      CollisionCategoryOpponent     = 1 &lt;&lt; 1,
      CollisionCategoryPlatform   = 1 &lt;&lt; 2,
      CollisionCategoryPlatformBorder = 1 &lt;&lt; 3,
  };
  
  
  //static inline CGFloat skRandf() {
  //  return rand() / (CGFloat) RAND_MAX;
  //}
  
  - (void)createSceneContents
  {
      self.backgroundColor = [SKColor purpleColor];
      self.scaleMode = SKSceneScaleModeAspectFit;
      self.multipleTouchEnabled = YES;
  
  }
  
  -(id)initWithSize:(CGSize)size
  {
      if (self = [super initWithSize:size])
      {
  
          self.physicsWorld.contactDelegate = self;
  
      }
      return self;
  }
  
  - (SKSpriteNode *)addPlayer {
  
      self._player = [SKSpriteNode spriteNodeWithTexture: [SKTexture textureWithImageNamed:@"TurnipSmall"]];
      self._player.position = CGPointMake(100,450);
      self._player.anchorPoint = CGPointMake(0.5,0.5);
      self._player.physicsBody = [SKPhysicsBody bodyWithTexture:self._player.texture size:self._player.texture.size];
      self._player.name = @"player";
      self._player.physicsBody.dynamic = YES;
      self._player.physicsBody.allowsRotation = FALSE;
      self._player.physicsBody.affectedByGravity = TRUE;
      self._player.physicsBody.friction = 5;
      self._player.physicsBody.mass = 10;
      self._player.physicsBody.usesPreciseCollisionDetection = YES;
      self._player.physicsBody.restitution = 0.0;
      self._player.physicsBody.categoryBitMask = CollisionCategoryPlayer;
      self._player.physicsBody.collisionBitMask = CollisionCategoryPlayer | CollisionCategoryOpponent | CollisionCategoryPlatform;
      self._player.physicsBody.contactTestBitMask = CollisionCategoryPlayer | CollisionCategoryOpponent | CollisionCategoryPlatform;
      self.playerPunching = false;
      [self addChild:self._player];
  
      return self._player;
  }
  
  - (SKSpriteNode *)addOpponent {
  
      self._opponent = [SKSpriteNode spriteNodeWithTexture: [SKTexture textureWithImageNamed:@"Tomato"]];
      self._opponent.position = CGPointMake(300, 450);
      self._opponent.anchorPoint = CGPointMake(0.5, 0.5);
      self._opponent.physicsBody = [SKPhysicsBody bodyWithTexture:self._opponent.texture size:self._opponent.texture.size];
      self._opponent.name = @"opponent";
      self._opponent.physicsBody.dynamic = YES;
      self._opponent.physicsBody.allowsRotation = NO;
      self._opponent.physicsBody.affectedByGravity = YES;
      self._opponent.physicsBody.friction = 5;
      self._opponent.physicsBody.mass = 10;
      self._opponent.physicsBody.density = 5;
      self._opponent.physicsBody.usesPreciseCollisionDetection = YES;
      self._opponent.physicsBody.restitution = 0;
      self._opponent.physicsBody.velocity = CGVectorMake(0, 0);
      self._opponent.physicsBody.categoryBitMask = CollisionCategoryOpponent;
      self._opponent.physicsBody.collisionBitMask = CollisionCategoryPlatform| CollisionCategoryPlayer;
      self._opponent.physicsBody.contactTestBitMask = CollisionCategoryPlayer | CollisionCategoryPlatform;
      [self addChild:self._opponent];
  
  
      return self._opponent;
  }
  
  - (void)didBeginContact:(SKPhysicsContact *)contact
  {
      SKPhysicsBody *firstBody, *secondBody;
  
      if (contact.bodyA.categoryBitMask &lt; contact.bodyB.categoryBitMask)
      {
          firstBody = contact.bodyA;
          secondBody = contact.bodyB;
      }
      else
      {
          firstBody = contact.bodyB;
          secondBody = contact.bodyA;
      }
      if ((firstBody.categoryBitMask &amp; CollisionCategoryPlayer) != 0 &amp;&amp; (secondBody.categoryBitMask &amp; CollisionCategoryOpponent))
      {
          [self playerTouchingOpponent];
      }
  
  }
  </code></pre>
  
  <p>GameScene.h:</p>
  
  <pre><code>//
  //  GameScene.h
  //  TEST
  //
  
  //  Copyright (c) 2014 G Hui. All rights reserved.
  //
  
  #import &lt;SpriteKit/SpriteKit.h&gt;
  
  @interface GameScene : SKScene &lt;SKPhysicsContactDelegate&gt;
  @property bool multipleTouchEnabled;
  @property BOOL contentCreated;
  @property SKSpriteNode * _donut;
  @property SKSpriteNode * _player;
  @property SKSpriteNode * _opponent;
  @property SKSpriteNode *platform1Scene1;
  @property BOOL movementBegins;
  @property NSArray *level1;
  @property BOOL playerPunching;
  @property bool alreadyPunching;
  @property float characterNumber;
  @property SKSpriteNode *platform2Scene1;
  @property SKSpriteNode *platform3Scene1;
  @property float playerHealth;
  @property SKSpriteNode *_healthBar;
  @property SKSpriteNode *rightplatformBorder;
  @property SKSpriteNode *mask;
  @property SKNode *_playerHealthBar;
  @property SKNode *_opponentHealthBar;
  @property SKNode *_playerPowerUpBar;
  @property SKNode *_opponentPowerUpBar;
  @property int _playerHP;
  @property int _opponentHP;
  @property const int MaxHP;
  @property int _playerPowerUp;
  @property int _opponentPowerUp;
  @property const int MaxPowerUp;
  @property const float healthBarWidth;
  @property const float healthBarHeight;
  @property const float powerBarWidth;
  @property const float powerBarHeight;
  @property bool touchingPlatform;
  @property SKSpriteNode *sideBorder;
  @property SKSpriteNode *frontBorder;
  @property BOOL playerOpponentContact;
  @property float distanceBetweenPlayerAndOpponent;
  @property float distanceBetweenOpponentAndPlayer;
  @end
  </code></pre>