I'm reading about NS_ENUM & NS_OPTIONS. The author says:
If you'd like to use either macro when targeting a previous version of iOS or OS X, you can simply inline like so:
#ifndef NS_ENUM #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type #endif
Is there any reason why you can't use these two macros on OS lower than iOS 6 (< iOS 6)? They are just macros, so independent of iOS versions, but related to a compiler (pre-processor) feature. I cannot find anything on it within the doc.
Any hint on that?
I agree the wording in the article is a bit confusing, as it makes it sound that this feature is runtime-dependent. But you're right, it's not dependent on the iOS version; it's just a language feature.
I think what the article is really trying to say is, if you were compiling your project using an older version of the iOS SDK (e.g. Xcode 4.4), then those macros won't exist and you'll need to manually define them to use them. However, if you're using the latest Xcode, where the macros are defined for you already, you can use these macros even if you're targeting older versions of iOS.