Take the 2-minute tour ×

Just stumbled into something strange with Xcode 4 and Cocoa frameworks. I've a meta-framework that is essentially a .h file with constants needed by a number of other frameworks I've created. I'm capable of creating and building the framework but every time I try to include it in a project Xcode would throw a hissy fit during the build phase, saying it couldn't find the framework, even though the .framework folder was there and the .h file was set to be publicly visible.

After many a hours of running in circles I decided to throw in a .m and corresponding .h files, just so I could have something binary in there and now Xcode is happy as Larry.

Can someone explain this behaviour to me? Why do I need a useless executable to make Xcode see my framework?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

The hissy fit is presumably coming from the linker. (Always post your error messages! Guessing isn’t that much fun.) As far as the linker is concerned, the binary is the framework. If you just want the header, you can include the framework in your search paths and #include the header without linking to the framework.

share|improve this answer
But then how do I copy the header? The Copy Build Phase breaks down too. –  lapinrigolo Apr 24 '11 at 13:28
+1 for "ALWAYS POST YOUR ERROR MESSAGES!" –  Joshua Nozzi Apr 24 '11 at 21:48

Your Answer


