0

A client of mine wants to create a combination app out of a few of their already established apps, I was wondering is there an easy way to add an entire project into another in xcode or something, my brute force method would be to just copy everything in resources and all into the new combo project and start re"linking".

Any insight on this kind of thing would be appreciated?

nickthedude
  • 4,925
  • 10
  • 36
  • 51

2 Answers2

1

Add it as a target dependency. See this question for assistance with that: Xcode : Adding a project as a build dependency

Then you will want to change the Header Search Paths so that you can reference your interface files (the .h files). This setting is in your project settings under the build tab in the Search Paths section. You will set it to where your interface files are relative to your current project. So if the base project were in the same folder you would just reference them like:

SomeProject/Classes

If you need to reference a directory outside of your own you can do something like:

../../Projects/SomeProject/Classes

Each ../ represents a parent directory

Then to use your base classes, just reference the .h files like normal. Keep in mind, however, that your AppDelegate class is it's own class and you will need to recreate the app's initial display (using your base classes) in this file (just duplicate the base class' appdelegate code).

These instructions aren't how I would do it were I starting with this idea in mind, but are provided to help you where you are. If I were starting from scratch knowing that I was going to be reusing a lot of my code, I would create three projects. One for shared classes that I would reference using the above techniques in the two separate apps that use them (each their own project).

This isn't great, but it's still better than just copying the whole project and having to maintain them both for each minor change.

Community
  • 1
  • 1
theChrisKent
  • 15,029
  • 3
  • 61
  • 62
0

You can drag folders from one xcode project window to another to create the composite project and links will be formed to the files in their existing locations.

You will just get an evil mish-mash when you go to link initially.

But it is a good way to keep the organisation of the projects the same across your code-base.

Warren Burton
  • 17,451
  • 3
  • 53
  • 73