xcode:共享2个目标的.pch文件(xcode: share .pch file for 2 targets)

我发布了我的iPhone应用程序的精简版,并且在商店里。 现在,我想添加“完整”版本的代码,并陷入困境。

在项目中添加第二个目标后,Lite版本编译正常,但完整版本没有。 这是因为_Prefic.pch文件中定义的宏对代码的完整版本不可见。

项目可以有多个.pch文件吗? 如果不是,如何指定XCode与两个目标共享.pch文件?

I published lite version of my iPhone-app and is in the store. Now, I want to add the code for the 'full' version and am stuck at a point.

After adding the second target in the project, the lite version compiles fine, but the full version does not. This is because the macro defined in _Prefic.pch file is not visible to the full version of the code.

Can a project have multiple .pch files? If no, how do I specify XCode to share the .pch file with both targets?

最满意答案

右键单击目标并选择“获取信息”。 在“构建”部分中搜索“前缀标题”设置并查看其值。 根据需要设置值(到新文件或已存在的文件)。

Right-click on your target and choose "Get Info". In the "Build" section search for "Prefix Header" setting and look at its value. Set the value as needed (to a new file or to already existing one).

xcode:共享2个目标的.pch文件(xcode: share .pch file for 2 targets)

我发布了我的iPhone应用程序的精简版,并且在商店里。 现在,我想添加“完整”版本的代码,并陷入困境。

在项目中添加第二个目标后,Lite版本编译正常,但完整版本没有。 这是因为_Prefic.pch文件中定义的宏对代码的完整版本不可见。

项目可以有多个.pch文件吗? 如果不是,如何指定XCode与两个目标共享.pch文件?

I published lite version of my iPhone-app and is in the store. Now, I want to add the code for the 'full' version and am stuck at a point.

After adding the second target in the project, the lite version compiles fine, but the full version does not. This is because the macro defined in _Prefic.pch file is not visible to the full version of the code.

Can a project have multiple .pch files? If no, how do I specify XCode to share the .pch file with both targets?

最满意答案

右键单击目标并选择“获取信息”。 在“构建”部分中搜索“前缀标题”设置并查看其值。 根据需要设置值(到新文件或已存在的文件)。

Right-click on your target and choose "Get Info". In the "Build" section search for "Prefix Header" setting and look at its value. Set the value as needed (to a new file or to already existing one).