问题
currently, the hierarchy is flattened out, and all the headers files are copied into a single Headers directory, no matter what subfolder they were in, in my Classes folder.
This is a problem when referencing the headers, if the headers have "include" statements that reference other headers in subfolders.
in particular, this screws up BridgeSupport compilation.
回答1:
My understanding is the Copy Headers behavior always flattens the file structure. You can either add a custom file copy or a custom script at the end of the process that copies (cp -r) the headers from their original location to your desired destination. These are viable workarounds for now. Meanwhile, definitely post your request to bugreport.apple.com.
回答2:
Add source folder as reference to folder (radio button in the "Add files..." dialog). Then drag'n'drop those folders to "Build Phases->Copy Files". After this headers will be located in folders on next build.
回答3:
From http://lists.apple.com/archives/xcode-users/2007/Oct/msg00162.html
"Try adding the folder containing the header to Xcode as a folder reference, and then add that to the Copy Headers build phase (you'll probably have to drag-drop it into the phase rather than checking the checkbox in the detail view). Folder references are the mechanism Xcode provides for preserving a directory hierarchy during a copy."
来源:https://stackoverflow.com/questions/5071425/how-can-i-preserve-subgroups-when-changing-role-to-public-in-copy-headers-build