简体   繁体   中英

Adding framework projects in Xcode

I am pretty new in iOS development, and I found a library I'd like to use in my app:

https://github.com/ustwo/US2FormValidator

I followed the steps the authors described in their documentation to import their project into mine, but Im not able to #import the imported project's .h files from my code. I also see that the library item in target's build phases remains in red. Maybe I am not importing the project properly, I copied the whole project folder into mine's folder, and then in the Xcode's project navigator of my project: right click > Add files to project > select the .xcodeproj file of the project I want to import, and that have been copied into my project folder. Is that the way to do this?

我终于通过设置Header Search Paths来实现它 ,之前添加了目标依赖项并将二进制文件与Build Phases中的库相关联...感谢大家的答案。

You appear to have imported the project properly. (You didn't have to necessarily copy the project folder inside yours, but personal preference...) Normally Xcode does the right thing connecting up headers and source files, but I've had to occasionally manually add files to the target's Build Phases window. (Especially adding headers to the Copy Headers build phase if your subproject builds a static library.) Speaking of which, make sure that you add the appropriate target to the Target Dependencies list so that Xcode knows to compile its requisite files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM