Search code examples
iphoneiosbuildxcode4header-files

Using $(BUILT_PRODUCTS_DIR) in User Header Search Path


When I use $(BUILT_PRODUCTS_DIR) in User Header Search Path (as recommended in this tutorial about static libraries) XCode 4 resolves it like this:

enter image description here

This is a problem while I work with the simulator, because the build files are stored in Debug-iphonesimulator instead of Debug-iphoneos, and XCode fails to find headers.

My current workaround is build first for iOS Device, and then work with the Simulator. This is a bit tedious and error-prone. What am I doing wrong?


Solution

  • The build products directory should be used for output by Xcode, and it is perfectly reasonable for these directories to be nonexistent at the time you begin to build. It is not advisable to have dependencies like user headers in these directories.

    My recommendation would be to move the dependent headers out of the directory you're talking about.