简体   繁体   English

XCode - 编辑xcodeproj包(特别是project.pbxproj)

[英]XCode - Editing xcodeproj bundle (specifically project.pbxproj)

I'm working in XCode and I've also written an external editor tool that generates resources for use in the project. 我正在使用XCode,我还编写了一个外部编辑器工具,可以生成用于项目的资源。 In the best case scenario, the tool would edit the project.pbxproj file so that it includes the generated resources in the project. 在最好的情况下,该工具将编辑project.pbxproj文件,以便它包含项目中生成的资源。 I've read through the file in an attempt to understand it, and it's mostly discernible but there is still one major question I have. 我已经阅读了该文件以试图理解它,并且它几乎可以辨别,但我仍然有一个主要问题。

If I wanted to generate a new Group from outside XCode (or a new anything, for that matter), how do I know what ID code to use? 如果我想从XCode外部生成一个新的组(或者新的任何东西,那么),我如何知道要使用的ID代码? For example: 19C28FACFE9D520D11CA2CBB is one of them from my project. 例如:19C28FACFE9D520D11CA2CBB是我项目中的其中一个。 How am I supposed to know what to use if I make my own? 如果我自己做,我该怎么知道该怎么用? Do they just need to be unique? 他们只需要独一无二吗? Would it be legal to just make one up: 000000000000000000000001 and 000000000000000000000002 and 000000000000000000000003 etc. ? 只做一个是合法的:000000000000000000000001和000000000000000000000002和000000000000000000000003等?

Any help on this would be wonderful. 对此的任何帮助都会很精彩。 Thanks. 谢谢。

Yes, you can make your own. 是的,你可以自己做。 The best way would be to use a hash function such as MD5 or SHA1 to generate it then you can truncate it at the desired length. 最好的方法是使用哈希函数(如MD5或SHA1)生成它,然后可以按所需长度截断它。 I would hash the name of the file/group along with a time stamp appended this way you get a more unique result. 我会散列文件/组的名称以及附加的时间戳,这样你就可以获得更独特的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM