I’m building a static library for iOS (.a file), and I have multiple headers that should be publicly accessible. I currently have 3 headers and a 4th header that #imports all 3, but this still means that when I distribute it, I have multiple header files.
Is there any way to have Xcode automatically copy and paste the contents of a header where the #import statement is when the framework/library compiles, so the 1 header sitting next to the library contains the contents of 3 other headers instead of 3 #import statements? (i.e. Run the preprocessor on a header it doesn’t compile)
I could always copy and paste manually every time, but I’m too lazy ;P.
You could add a “Run Script Build Phase” to your library target, so that each time you build the library a shell script could append the three files in one general file.
Have a look to this for more info about Xcode 3.x.
In Xcode 4, it is similar. You select your target, then the Build Phases tab, and there you can put your script under “Run Script”.