Possible Duplicate:
Check iPhone iOS Version
I tried with this code:
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_2_2)
NSLog(@"iPhone 4.2");
#endif
but when I run it again on simulator 4.1, I still get the log "iPhone 4.2" in console.
Thanks for helping me.
Tung Do
You should probably avoid asking about the system version altogether.
A better design would ask about a specific feature.
For instance: if (NSClassFromString(@"UIPrintInfo"))
would tell you if the current device supports the printing API,available in 4.2 or higher.
That way you can plan your code to use a feature if it's available, on not based on the OS version.
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With