You need to add an explicit dependency between the generated file and your target.
Open the DerivedData directory in Finder, select the mytest.h file and drag it into Xcode inside your project. Usually I create a new group called Derived Files and place such files under it.
To easily find the DerivedData directory, I change the project settings so that it is relative to the catalog project (see File → Project Settings, Creation tab).
After the file is referenced in the project, you need to add it to the main Compile Sources rule. Select the main goal of the project, expand the compilation sources, if it is not already expanded, and drag the newly added derived file to the list of files for compilation.
Finally, since you really want to compile this file, you can rename it to .m or .c instead of .h.
Update: Actually looks like the one shown above, does not work all the time. The most reliable way is to use the build phase instead of the build rule.
source share