开发者

importance of <ApplicationName>_prefix.pch file

开发者 https://www.devze.com 2023-02-04 16:18 出处:网络
What is the importance of impo开发者_运维百科rtance of _prefix.pch file?Conceptually, it\'s included at the top of every translation unit (i.e. every compiled C, C++, Objective-C, or Objective-C++ fil

What is the importance of impo开发者_运维百科rtance of _prefix.pch file?


Conceptually, it's included at the top of every translation unit (i.e. every compiled C, C++, Objective-C, or Objective-C++ file.) So you can force every file in your project to include a particular macro by adding this to your .pch file:

#if !defined(MY_MACRO)
    #define MY_MACRO (12345)
#endif /* !defined(MY_MACRO) */

And then MY_MACRO is always available. It's also commonly used to import framework headers so you don't have to run around typing #import <Foundation/Foundation.h> in every file.

0

精彩评论

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