什么是Xcode中的Prefix.pch文件? [英] What is Prefix.pch file in Xcode?

查看:62
本文介绍了什么是Xcode中的Prefix.pch文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多开发人员都在Prefix.pch中添加了各种便利宏.但是我的问题是Prefix.pch文件是什么.

So many developers are adding various convenience macros to the Prefix.pch. But my question is what is that Prefix.pch file.

  • 如果我从Xcode中删除了Prefix.pch文件,那么我的应用程序将运行吗?还是会显示任何错误?还是在构建过程中崩溃?

  • If i remove that Prefix.pch file from my Xcode, then will my application run? Or will it show any error? Or will it crash during build?

如何在没有Prefix.pch文件的情况下运行我的应用程序

How can i run my application without Prefix.pch file

推荐答案

预编译头文件.

什么?

A Prefix.pch是预编译的头.发明了预编译头文件,以加快编译速度.这些文件不会一次又一次地解析相同的头文件,而是会被提前解析一次.

Precompiled header.

What is it?

A Prefix.pch is a precompiled header. Precompiled headers were invented to make compiling faster. Rather than parsing the same header files over and over, these files get parsed once, ahead of time.

在Xcode中,您可以在前缀头"中添加所需的头文件的导入,并启用Precompile Prefix Header以便对其进行预编译.但是,前缀标头背后的思想与预编译不同.

In Xcode, you add imports of the header files you want in a "prefix header," and enabling Precompile Prefix Header so they get precompiled. But the idea behind a prefix header is different from precompiling.

每个源文件的开头都隐含了前缀标头.就像每个源文件都添加了

A prefix header is implicitly included at the start of every source file. It’s like each source file adds

#import "Prefix.pch"

在文件顶部,然后再进行其他操作.

at the top of the file, before anything else.

您可以删除预编译的头文件.我在下面链接的线程中已经回答了这个问题.它包含您需要的所有信息以及有用的注释.

You can remove the precompiled header. This question has been already answered in thread I'm linking below. It contains all the information you need as well as useful comments.

可以删除吗Xcode项目中的Prefix.pch文件?

这篇关于什么是Xcode中的Prefix.pch文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆