Create two iPhone apps from common code

I have an application for the iPhone, and I take several functions of the application and create a new application.

How can I create two applications from a common code base?

+4
source share
5 answers

If you understood correctly, this article is what you are looking for:

+2
source

Another option that no one mentioned is that you can create a new target in the project source file. I do this for the "free" and "paid" versions of the same application, but this would be useful for any two applications that have shared access to the same code.

+5
source

I got this from an Xcode expert:

Xcode has two advantages to doing the right thing here:

1) For files outside the project tree that your project requires, configure the source tree. Xcode> Preferences> Source Trees, define a symbolic path (e.g. EXTRA_SOURCES) with the actual path on your disk to where they were extracted. Then, when you add these files to your project, add them relative to the source tree in that source tree.

(NB Close and restart Xcode after defining the source tree in Prefs.)

2) In Xcode 3.2, define the roots of the project to include the Source Tree. Project> Change project settings> General tab, Configure Roots and SCM button. Add the source tree to Project Roots and set up its repository, which can be a separate repository from your main project files.

What is it. You have one file tree from one repository, but many projects can share it, and if you perform the SCM operation on the source in one project, this is reflected in others.

+3
source

Ideally, you could create a dynamically linked shared library (or framework "in the Apple language) from shared code, but the iPhone platform does not support this . In addition to the approaches already suggested here, you can link your own static libraries.

+1
source

Keep the shared code in a shared repository. Then you can easily use it in as many projects as you want.

0
source

All Articles