__OBJC__ in objective C

后端 未结 3 1822
悲&欢浪女
悲&欢浪女 2021-02-01 04:53

What does __OBJC__ mean in Objective C?

#import 

#ifdef __OBJC__
    #import 
    #import <         


        
3条回答
  •  情书的邮戳
    2021-02-01 05:22

    Its just a macro symbol. In this case if that symbol is defined then your program should import the Apple Cocoa frameworks (Foundation and AppKit).

    This woudl be the case if you were developing an objective-c / cocoa application. In other words, if you were developing a C++ / carbon application, the __OBJC__ symbol would not be defined and those objective-c dependant frameworks would not be imported.

提交回复
热议问题