Make changes to Xcode project templates

こ雲淡風輕ζ 提交于 2019-12-25 02:29:08

问题


I have read a few posts about creating/editing Xcode project templates, but they don't seem to work with Xcode 5.

The directory in which I have to make changes is, /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate

However, I can't figure out a place where I can make changes and include the header files and other statements that I wish to add.

I have even tried editing C++ class in the File Template. However, the problem is that the custom class comes into play only when I add a new c++ class to the project. No changes are visible are in main.cpp


回答1:


You have the project file here which sets up the base files needed and not extra files.

When you add a new file you us a template under /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates

To do this for a C++ class copy /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate to ~//Library/Developer/Xcode/Templates/File Templates/<myGroup>/C++ File.xctemplate (replacing by the group name you want. Then edit the files in this target directory.



来源:https://stackoverflow.com/questions/24409406/make-changes-to-xcode-project-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!