Differentiate Project and PBXProject #12

Closed
mtitolo opened this Issue Mar 26, 2013 · 6 comments

Comments

Projects
None yet
4 participants
Member

mtitolo commented Mar 26, 2013

It should be explicitly stated that these are not the same objects. Also, adding a type next to the attribute name (which helps with Issue #7 ) would also help resolve this confusion.

Owner

floere commented Mar 28, 2013

Hi Michele,

Thanks for the issue entry! Would you mind making a suggestion on how to improve this via pull request? :)

Cheers,
Florian

Member

mtitolo commented Apr 3, 2013

I'm working on some updates for this. It's slightly confusing for a few reasons.

The main problem I'm having is that the .xcodeproj file is actually a folder, so it contains absolutely no data. This was part of my initial confusion: I expected the gem model to match the filesystem representation, which is an incorrect assumption.

All of the important information is in the project.pbxproj. If you want to really work with the Xcodeproj gem, you're going to want to base what you do off of the PBXProject, not Project. Also, the project.pbxproj will be updated frequently, while the .xcodeproj itself never changes, because it's a folder. I'm trying to work this in somehow, because I expect this gem to start getting more use as more iOS developers find how awesome it is.

Owner

alloy commented Apr 3, 2013

@mtitolo I completely agree! It’s not, however, clear to me if you’re currently looking for feedback or if you are working on a patch and simply reporting on what it will look like.

Member

mtitolo commented Apr 3, 2013

@alloy I'm working on my patch, but I'm open to suggestions for clarifying this, if anyone has them.

Owner

alloy commented Apr 3, 2013

Ok, let me try to expand on your findings.

The main problem I'm having is that the .xcodeproj file is actually a folder, so it contains absolutely no data. This was part of my initial confusion: I expected the gem model to match the filesystem representation, which is an incorrect assumption.

On OS X (and iOS), a ‘bundle’ is simply a directory that contains all the required data it represents, but is shown to the user as a file. (This is used for many ‘document’ types, including even applications.)

In this case, a ‘xcodeproj’ document contains a ‘pbxproj’ which contains the actual data and other files that are considered ‘user data’. (These are settings like the positions of all the views in Xcode, so that it will open with the same state on the next run.)

Now regarding the gem, as you saw, this same structure is being reflected and it can be regarded in the same way. I.e. the Project is considered ‘the project document’ and PBXProject is an object that is the root object in the actual backing data.

In this regard, I think this sentence in the documentation is misleading, maybe that was part of the confusion?

In the end, just like with ‘bundles’, the gem abstracts the inner details away by appending project.pbxproj itself, so there should normally not be a reason for the user to deal with this.

HTH, let us know if you want to know anything.

Owner

orta commented Nov 27, 2014

Closing as this has been superseded by the guides.

orta closed this Nov 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment