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?
You can have the libraries installed without the headers. You can't then compile code that uses the header, but you can run code that uses the shared library.
Open XCode and start a new project. Under iOS, select Library and “Cocoa Touch Static Library” say it as "staticlibrary". This will create a nice new project for us that builds a . a file.
Holding the Command key, click the import/include statement to view the header. Also, you can Command-click on a symbol to jump to the header file that defines it.
Add Headers files
Xcode 10.2.1
Project editor -> select a target -> Build Phases -> + Add a new Build Phase -> New Header Phase
The second step is to add .h
files
//Build Phases
Project editor -> select a target -> Build Phases -> Headers -> add files to the **public** zone
//or
//Target Membership
Select `.h` file -> Select File Inspectors Tab -> Target Membership -> Select the target and make it **public**
[Target Membership]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With