I want to make a small define for my project. That define should just execute a code if its above an ios version. It looks like this
#define IF_OS_8_OR_LATER(CODE) \
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) \
{ \
CODE; \
}
Its quite simple and working for this kind of stuff
IF_OS_8_OR_LATER(_locationManager.allowsBackgroundLocationUpdates = YES);
But now i want to extend this to avoid the "not available in deployment target" warning in my IDE (AppCode). I thought of extending it to this
#define IF_OS_8_OR_LATER(CODE) \
_Pragma("clang diagnostic push") \
_Pragma("ide diagnostic ignored \"UnavailableInDeploymentTarget\"") \
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) \
{ \
CODE; \
} \
_Pragma("clang diagnostic pop")
But this is not working unfortunately. Any suggestions how to achieve this?