Xcode 4.2 How Include One Project into Another One

Xcode 4.2 how include one project into another one?

This makes a lot of sense when you are trying to add a static library to your xcode projects. There are a couple steps required for doing this. First, make sure that the static library project is not open in XCode.

Then start by dragging and dropping the static library xcodeproj file (from the Finder) onto your app's xcode project.
StaticLib

After this you need to add this library to your app's build phases. Click on the main project, and select the BuildPhases tab of the target.

Build Phases

You're going to want to add the other project to the Target Dependencies and to your Link Binary With Libraries Section.

Finally, the app needs to be aware of your headers. Therefore, you need to add the path to your static libraries classes to your User Header Search Paths. Go to the Build Settings of the Main Target and search for Header Search Path.

Header Search Path

This will make your app aware of the new static library.

Sometimes you need to add a few Other Linker Flags. In the Build Settings search for Other Linker Flags and add -all_load and -ObjC

Other Linker Flags

Hope this helps, I know the first time I tried to do this I was banging my head against the wall for a while.

Import XCode project inside another XCode project

Try adding the location of your other project to the Header Search Paths in the Build Settings of the main project.

how to integrate two project in xcode?

This makes a lot of sense when you are trying to integrate two project into one. There are a couple steps required for doing this.you can refer following link to do this. Xcode 4.2 how include one project into another one?

How can add a Xcode project into another project?

You can add a new build target in a project and add the source files of the new project to it and even share common used source files. There is a WWDC video about migrating an app form iOS to OSX look it up. Somewhere it explains how to do ti.

How do you move an Xcode 4.2 project file to another folder?

Here is how you do it (I'm using in Xcode 4.3):

First, move your project file

1. Start out by closing the Xcode project
1. Move ProjectName.xcodeproj into the folder with all your code

1. Open the XCode project by clicking ProjectName.xcodeproj

Second, re-map your files

1. You do not need to remap the files one by one, you only need to map the groups

1. Open the "File Inspector" with ⌥⌘1 or View->Utilities->Show File Inspector

1. Click each group, then click the square icon (see screenshot below) and choose the folder your project file is in.

Icon to click:
Sample Image

"None" will show up when you choose the same folder your .xcodeproj file is in.

Conclusion:

I have a large project which contains ~650 files, but only 12 groups, so it takes just a few minutes to re-map everything.

Note:

Sometimes when mapping the files it doesn't recognize a folder change if the name is the same (ie. two folders with the same name). You may have to pick any other folder temporarily, then choose the actual project folder and the None indicator will appear.

Drag and drop XCodeProj into another XCodeProj not giving me the option to copy

Edit: My solution works, but the reason it works is in this answer: https://stackoverflow.com/a/5373575/264947

--

This is what I did to fix it:

  1. Close Xcode.
  2. Open Xcode and create a new workspace.
  3. File > Add files to "Workspace".
  4. Add the first project.
  5. Build to make sure it builds correctly.
  6. File > Add files to "Workspace".
  7. Add the second project.
  8. Build to make sure it builds correctly.
  9. Drag one project into another.

Now, be careful with the next step:

Erase the second standalone project but choose **REMOVE REFERENCES. **

There. Now you should have one project as a dependent of another project.



Related Topics



Leave a reply



Submit