title: "Incompatible pointer to integer conversion initializing 'int' with an expression of type 'NSNumber *'"
body: <p>I suspect this is something really simple, but I'm trying to get an int that I have stored in a  dictionary and the line I'm using is this..</p>
  
  <pre><code> int mapX = [NSNumber numberWithInt:[templateObject valueForKey:@"mapX"]];
  </code></pre>
  
  <p>But it's giving me the error...</p>
  
  <blockquote>
    <p>Incompatible pointer to integer conversion sending 'id' to parameter
    of type 'int'</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>Incompatible pointer to integer conversion initializing 'int' with an
    expression of type 'NSNumber *'; </p>
  </blockquote>
  
  <p>If I try...</p>
  
  <pre><code>NSNumber *mapX = [NSNumber numberWithInt:[templateObject valueForKey:@"mapX"]];
  </code></pre>
  
  <p>I basically get the same error. I know I'm probably just using the wrong syntax, but I'm not sure how else to write it.</p>
  
  <p>Thanks for any help.</p>