title: Storing objects in an array in objective c
body: <p>I'm trying to store 25 objects in an array</p>
  
  <pre><code>for (int iy=0; iy&lt;5; iy++) {
          for (int ix=0; ix&lt;5; ix++) {
  
              TerrainHex *myObject = [[TerrainHex alloc] initWithName:(@"grassHex instance 10000") width:mGameWidth height:mGameHeight indexX:ix indexY:iy];
              myObject.myImage.y += 100;
  
              [TerrainHexArray addObject:myObject];
  
              [self addChild:(id)myObject.myImage];
          }
      }
      NSLog(@"Terrain array: %u", [TerrainHexArray count]);
  </code></pre>
  
  <p>The log is coming back as zero though.</p>
  
  <p>In the .h file I have</p>
  
  <pre><code>@property NSMutableArray *TerrainHexArray;
  </code></pre>
  
  <p>And in the .m file I have..</p>
  
  <pre><code>@synthesize TerrainHexArray;
  </code></pre>
  
  <p>I just tried what someone suggested below, which is..</p>
  
  <pre><code>NSMutableArray *TerrainHexArray = [[NSMutableArray] alloc] init];
  </code></pre>
  
  <p>But it's just giving me a warning saying expected identifier.</p>