title: XCode - Redefine macro
body: <p>Small problem I'm having where I have an amount of objects (enemies) on the screen at one particular time and cannot redefine their value. I set my enemies to begin with 3 on the screen. </p>
  
  <p>My objective is to change the amount of enemies based on the current score. </p>
  
  <p>I've attached snippets of the code below.</p>
  
  <pre><code>#define kEnemies 3
  
  - (void) EnemyIncrease 
  {
      if (self.score&gt;=100) {
      #define kEnemies 4
      }
  }
  </code></pre>
  
  <p>// I've also tried amongst other things</p>
  
  <pre><code>#define kEnemies 3
  
  - (void) EnemyIncrease
  {
    if (self.score &gt;=100) {
      #undef kEnemies
      #define kEnemies 6
    }
  }
  </code></pre>
  
  <p>Would really appreciate some assistance. </p>
  
  <hr>
  
  <p>I have now changed my code to the following</p>
  
  <pre><code>int numberOfEnemies;
  
  if (self.score&gt;=0) {
   numberOfEnemies = 3
  }
  
  else if (self.score&gt;=100) {
   numberOfEnemies = 4
  }
  </code></pre>
  
  <p>however the issue now is that the array does not update the numberOfEnemies when the score meets the new condition.</p>
  
  <pre><code>for(int i = 0; i &lt; numberOfEnemies; i++)
  </code></pre>
  
  <p>Apologies I'm still new to coding and trying to modify existing code</p>