title: Best way to programmatically detect iPad/iPhone hardware
body: <p>The reason I need to find out is that on an iPad, a UIPickerView has the same height in landscape orientation as it does in portrait. On an iPhone it is different. The iPad programming guide introduces an "idiom" value to UIDevice:</p>
  
  <pre><code>    UIDevice* thisDevice = [UIDevice currentDevice];
      if(thisDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)
      {
          // iPad
      }
      else
      {
          // iPhone
      }
  </code></pre>
  
  <p>which works OK while you're in iPad (3.2) but not iPhone (3.1.3) - so it looks like there also needs to be an ifdef to conditionally compile that check, like:</p>
  
  <pre><code>#if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 30200
          UIDevice* thisDevice = [UIDevice currentDevice];
          if(thisDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)
          {
              // etc.
          }
  #endif
  </code></pre>
  
  <p>To me that's starting to look very clumsy. What's a better way?</p>