Xcode 4 workspace, cross-referencing files

2019-08-07 18:50发布

问题:

I am currently switching from developing two separate Xcode Projects into using Xcode workspace. And thus have a question.

After I import two of my projects into workspace, how do I tell one project to search for files in another project?

What I would like to accomplish is to get rid of duplicate classes that are the same for both project and keep them only in one project.

Example. In project A I have a class Book I would like to use this class in project B but not to be forced to actually have it.

回答1:

Two propositions, I am assuming your project A and B are two iOS applications :

  • Share files accross projects

    (just reference files, do not copy, should use a common/ folder to stay clean and safe)

  • Create a static library referenced by both projects (more complex...)