title: EXC_BAD_ACCESS for assignment of ID to Tile object
body: <p>The implementation for a Tile object (an array of which forms a map object) is as follows</p>
  
  <pre><code>#include "Tile.h"
  
  Tile::Tile(){
      isPassable_ = true;
  }
  
  void Tile::setID(int ID){
      ID_ = ID;
      Tile::setVals(ID);
  }
  
  void Tile::setVals(int ID){
      switch(ID){
          case 1 : Tile::GFX_ = '.'; Tile::name_ = "Grass"; Tile::desc_ = "Some grass";
          default: Tile::GFX_ = '?'; Tile::name_ = "Error"; Tile::desc_ = "Error"; Tile::isPassable_ = false;
      }
  }
  
  int Tile::getID(){return ID_;}
  char Tile::getGFX(){return GFX_;}
  std::string Tile::getName(){return name_;}
  std::string Tile::getDesc(){return desc_;}
  bool Tile::getIsPassable(){return isPassable_;}
  </code></pre>
  
  <p>Where HEIGHT and WIDTH are constant ints defined in the Map header. However, when the program runs, I receive an error for <code>ID_ = ID;</code> saying "Thread 1: EXC_BAD_ACCESS(code=1,address=0x0). Could this be a problem with the way that I'm accessing the Tile objects in its 2D array in the Map object, as follows</p>
  
  <pre><code>#include "Map.h"
  
  Map::Map(int buffMap[][WIDTH]){
      for(int y = 0; y &lt; HEIGHT-1; y++){
          for(int x = 0; x &lt; WIDTH-1; x++){
              map_[y][x]-&gt;setID(1);
          }
      }
      for(int y = 0; y &lt; HEIGHT-1; y++){
          for(int x = 0; x &lt; WIDTH-1; x++){
              map_[y][x]-&gt;setID(buffMap[y][x]);
          }
      }
  }
  </code></pre>
  
  <p>Thanks!</p>