title: iOS: Preprocessor for OS version check
body: <p>In the past I used the following preprocessor code to conditionally execute code for different iOS versions:</p>
  
  <pre><code>#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
  // target is iOS
      #if __IPHONE_OS_VERSION_MIN_REQUIRED &lt; 60000
      // target is lower than iOS 6.0
      #else
      // target is at least iOS 6.0
      #endif
  #endif
  </code></pre>
  
  <p>However with iOS 7 I have the following problem:</p>
  
  <pre><code>#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
  // target is iOS
      #if __IPHONE_OS_VERSION_MIN_REQUIRED &lt; 70000
      // target is lower than iOS 7.0
      NSLog(@"This message should only appear if iOS version is 6.x or lower");
      #else
      // target is at least iOS 7.0
      #endif
  #endif
  </code></pre>
  
  <p>The <code>NSLog</code> message above appears on console under iOS 7. Am I doing something wrong?</p>
  
  <p>EDIT: The following code running under iOS 7 (simulator and device)</p>
  
  <pre><code>NSLog(@"Version %i", __IPHONE_OS_VERSION_MIN_REQUIRED);
  </code></pre>
  
  <p>gives: Version 60000</p>