In Xcode 4, setting the user header search path violates the meaning of the code

My desired setup is the main project, which depends on the subproject (which generates a static library). Adding a subproject to Xcode works fine, but as you expect, you should set the user header search path to include the subproject folder, if you do not want to explicitly add subproject files to the main project, what types hit the target of the subproject.

From what I can say, setting the search path for the userโ€™s title will violate the meaning of the code and the navigation โ€œgo to definitionโ€ in the main project, the next time you open the project.

Here's an example, a super simple, stock project that illustrates a problem:

http://dl.dropbox.com/u/579169/MainProject.zip

If you go to the application delegate and try to go to the definition in the property reference, say self.window, Xcode just gives you a list of all the window properties that it knows about. Similarly, autocomplete does not work.

If you delete the user header search path, close the project and restart it, the meaning of the code will work as expected.

I filed an error with Apple, but wondered if anyone had encountered this particular problem or has a reasonable solution. Removing the project "derived" assembly to run reindex does not work reliably.

+7
source share
2 answers

The work around is to publish the headers in a static library. Then add the following user header search paths

"${BUILT_PRODUCTS_DIR}/usr/local/include/" 
+2
source

I reported this to Apple, and they report that it was fixed on 6/6/2011 in Xcode 4.1 (which is Lion only). I did not confirm this fix because I did not upgrade my development machine to the beta version of Lion.

+1
source

All Articles