I would like to detect iPhone OS version in my app. I have tried using detection code but was advised to use macros. Does someone experience, can you post sample code, and what library to use.
I am not certain what macros you are being advised to use. I always thought that the standard way to find the version number so that it will be compatiable with future and previous versions was to use
NSString* versionNumber = [[UIDevice currentDevice] systemVersion]
which gives it as a NSString such as @"2.0" or @"2.2.1"
There are the Version constants that describe the version of Foundation classes being used, with NSFoundationVersionNumber but I am uncertain of how reliable this will be in older and future code.
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