title: Why does an NSInteger variable have to be cast to long when used as a format argument?
body: <pre><code>NSInteger myInt = 1804809223;
  NSLog(@"%i", myInt); &lt;==== 
  </code></pre>
  
  <p>The code above produces an error:</p>
  
  <blockquote>
    <p>Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead</p>
  </blockquote>
  
  <p>The corrected <code>NSLog</code> message is actually <code>NSLog(@"%lg", (long) myInt);</code>. Why do I have to convert the integer value of <code>myInt</code> to <code>long</code> if I want the value to display?  </p>