-1

I need to check the system iOS Version in my App.

my deployment target is iOS 5.

However when i checked with following codes , the warning message is appearing.

*Warning Messages : System_version_less_than macro redefiend*

and the codes is :

#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

How to solve it?

Fire Fist
  • 7,032
  • 12
  • 63
  • 109

1 Answers1

1

Quickest & easiest answer here is to put this line:

#undef SYSTEM_VERSION_LESS_THAN

before your "#define" lines.

Then again, doing a bit more research into (the massively upvoted answer) where these "#define" lines came from, you may be #defining them in the wrong way. Are you putting them in a ".h" file that you are importing, or how else are you including or defining them?

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215