How can I execute code only for iOS 5 with iOS<5 compatibility? I have written this code:
BOOL isIOS5 = [[[UIDevice currentDevice] systemVersion] floatValue] > 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]];
}
If I execute the app in iOS 5 it works fine, but if I try to execute the app in iOS <5 emulator it breaks. Is there a way to write an app who has code only for iOS5 but ignores it when iOS<5?