I would like to detect iPhone OS version in the app, can you post sample code as well. I tried using macro that didn't help.
Thanks in advance
I would like to detect iPhone OS version in the app, can you post sample code as well. I tried using macro that didn't help.
Thanks in advance
You need to use the macros if you want conditional compilation:
#ifdef __IPHONE_3_0
// Works on >= version 3.0
#else
// Works on < version 3.0
#end
Or alternatively, to check at runtime, use:
float ver = [[[UIDevice currentDevice] systemVersion] floatValue];
if (ver >= 3.0) {
// Only executes on version 3 or above.
}