What's the difference between run-time, e.g., [[UIDevice currentDevice] systemVersion]
, and compile-time, e.g., __IPHONE_OS_VERSION_MIN_REQUIRED
checking? When should you one over the other?
Is__IPHONE_OS_VERSION_MIN_REQUIRED
just a variable set in Build Settings?
I've read the answers to How to target a specific iPhone version? and other related questions listed below.
But, I just noticed that __IPHONE_OS_VERSION_MIN_REQUIRED = 30200
when I build & run on iPhone (4.3.1) with Xcode 4. Why?
When you submit your code to Apple, do they compile a version of it for each version of the iPhone that exists, setting __IPHONE_OS_VERSION_MIN_REQUIRED
accordingly?
That way, you could inspect __IPHONE_OS_VERSION_MIN_REQUIRED
, and know what iOS version is running the code.