Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
687 views
in Technique[技术] by (71.8m points)

ios - How to teach Xcode to include all header files in output of static library project?

I followed a tutorial to create a static library project. Then I dragged in my classes and added them to the target.

When I build & run, it creates a libUtils.a file. Upon reveal in Finder the include folder only contains the header file for the first class that Xcode created automatically when I created the project. All other header files are missing.

I double-checked: All the added class files are part of the project and the inspector shows a target membership checkmark for the target project.

Is this a bug in Xcode or must I register all files I create additionally somewhere else?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Xcode automatically adds a build phase to copy the headers to the product directory. You can add new header files to this build phase:

enter image description here

Update:

You can also use "Copy Headers" build phase instead:

Editor menu > Add Build Phase > Add Copy Headers Build Phase.

And the header files will be added automatically to one of the categories when you add them to the project:

enter image description here

More info about this build phase and the three categories from iOS Developer Library.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...