xcode PBXBuildFile 与 PBXFileReference 部分
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12156169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PBXBuildFile vs PBXFileReference section
提问by János
What is the difference between PBXBuildFile and PBXFileReference in project.pbxproj? Does it matter if a file is listed in both of the sections? What is the policy what file in which section should get?
project.pbxproj 中的 PBXBuildFile 和 PBXFileReference 有什么区别?如果文件在两个部分中都列出,这有关系吗?应该在哪个部分获取哪个文件的策略是什么?
/* Begin PBXBuildFile section */
3D081B83146ACE36000CC86B /* B767.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D081B82146ACE36000CC86B /* B767.png */; };
/* Begin PBXFileReference section */
3D081B82146ACE36000CC86B /* B767.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = B767.png; sourceTree = "<group>"; };
回答by John Graziano
You should normally never have to worry about this, but it can come up in certain merge conflicts in the project.pbxproj file.
您通常不必担心这一点,但它可能会出现在 project.pbxproj 文件中的某些合并冲突中。
A PBXFileReference is a reference to the actual file. It's the object that backs up the files that appear in the left-hand project view.
PBXFileReference 是对实际文件的引用。它是备份出现在左侧项目视图中的文件的对象。
A PBXBuildFile is a file in a target. It wraps a PBXFileReference and adds certain attributes like per-file compiler flags. If a file is added to a target, it will be listed in both sections. If a file is in more than one target, it will have more than one PBXBuildFile in the build files section.
PBXBuildFile 是目标中的文件。它包装了一个 PBXFileReference 并添加了某些属性,例如每个文件的编译器标志。如果将文件添加到目标,它将在两个部分中列出。如果一个文件在多个目标中,它将在构建文件部分有多个 PBXBuildFile。