开发者

How do i know what version of ObjC language am i using?

开发者 https://www.devze.com 2023-03-29 17:38 出处:网络
This is kind of a sil开发者_运维技巧ly question, but really, how can i tell whether i am using ObjC version 2 or something else?

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
0

精彩评论

暂无评论...
验证码 换一张
取 消