This is kind of a sil开发者_运维技巧ly question, but really, how can i tell whether i am using ObjC version 2 or something else?
I can always assume "the latest", but i'd rather know :)
Is there a command line check i can run? Please advise
If you are running 10.5 or later, or any version of iOS, your computer is running Objective-C 2. If you are writing code which you want to work on systems before this, you can check for the __OBJC2__
macro, which will be defined only for Objective-C 2 and later systems.
#ifdef __OBJC2__
// use objective-c 2
#elif defined(__OBJC__)
// use objective-c 1
#else
// no objective-c
#endif
精彩评论