soleil
soleil

Reputation: 13085

Dependencies in Xcode Workspaces

I'm trying to set up a workspace so that different projects can access the same files.

In Project A, I did a "Save As Workspace..."

Then I created Project B in the new workspace.

I can now see both in the Project Navigator.

So say I have a category that was in Project A called "UIView+Awesome" that I want to use in Project B, how do I set up that dependency?

In a view controller of Project B I get this:

#import "UIView+Awesome.h" //UIView+Awesome.h file not found

Upvotes: 0

Views: 298

Answers (1)

Rafał Sroka
Rafał Sroka

Reputation: 40030

Here is how to solve it.

  1. Click on the target that's importing UIView+Awesome.h.
  2. Click on Build Settings.
  3. Enter Header Search Paths into the search box.
  4. Double click on the value cell.
  5. Click the + sign.
  6. Set the path to the project you're referring. Let's say it's called Awesomelib. The path is relative to the root of the referring project (the project that's using Awesomelib). For example: ../Awesomelib/src/headers/ or wherever it is that the .h file lives.
  7. Click Done.
  8. Clean and then Build.

Upvotes: 1

Related Questions