objective c - #ifdef #else #endif choose iOS sdk version and function? -
i buliding dark themed ios 6 , 7 app. understand can call [[uiapplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent]; make ios 7 status bar suit dark color theme application.
the problem going submit app app store , xcode 5 not ready that, have use xcode 4.6.x task. xcode 4.6, not able compile new method ios 7. think have ""if ios7"" [[uiapplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent]; , reposition application window.
i trying #ifdef ... #else... code [[uiapplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent]; inside viewdidload.
could understand how use #ifdef... method in functions.
thanks lot!!!!
while i'm not 100% sure can answer without breaching nda, i'll best point in right direction.
you need use __iphone_* #defines in availability.h
#if __iphone_os_version_max_allowed >= __iphone_6_0 // ios 6+ code here #else // pre ios 6 code here #endif please aware #if , #ifdef determine code compiled, not runtime detection mechanism.
you can access availability.h using open , typing in availability.
Comments
Post a Comment