title: How to execute code only for iOS 5 without breaking the app
body: <p>How can I execute code only for iOS 5 with iOS&lt;5 compatibility? I have written this code:</p>
  
  <pre><code> BOOL isIOS5 = [[[UIDevice currentDevice] systemVersion] floatValue] &gt; 4.3;
   if (isIOS5) {
  
      [[UINavigationBar appearance]setBackgroundImage:[UIImage imageNamed:@"cabecera.png"] forBarMetrics:UIBarMetricsDefault];
      [[UINavigationBar appearance]setTintColor:[UIColor colorWithRed:80.0f/255.0f green:150.0f/255.0f blue:185.0f/255.0f alpha:1]];
  
   }
  </code></pre>
  
  <p>If I execute the app in iOS 5 it works fine, but if I try  to execute the app in iOS &lt;5 emulator it breaks. Is there a way to write an app who has code only for iOS5 but ignores it when iOS&lt;5?</p>