简体   繁体   English

从我的项目ios引用外部库项目类或lib文件

[英]Referencing External Library project classes or lib file from my project ios

I need to divide some class files into the project library and i need to reference that library to my project. 我需要将一些类文件划分到项目库中,并且需要将该库引用到我的项目中。

Example: MyProjectXcode will be divided into MyProjectXcode, DatabaseLibraryXcode and NetworkLibraryXcode three different xcode projects, but DatabaseLibraryXcode, NetworkLibraryXcode are the library projects. 示例:MyProjectXcode将分为MyProjectXcode,DatabaseLibraryXcode和NetworkLibraryXcode三个不同的xcode项目,但是DatabaseLibraryXcode,NetworkLibraryXcode是库项目。

MyProjectXcode needs to reference the library classes. MyProjectXcode需要引用库类。 I tried by including the library inside MyProjectXcode it is working. 我通过将库包含在MyProjectXcode中进行了尝试。 But i dont want to drag the library into my project. 但是我不想将库拖到我的项目中。 I just need to reference those files. 我只需要引用这些文件。 I tried adding those project path in user header paths didn't worked. 我尝试在用户标头路径中添加这些项目路径无效。 Can any one help? 可以帮忙吗?

Open Project Settings>>Build Phases>>Link Binary With Libraries>> scroll down click on '+' sign and add Libraries from finder. 打开项目设置>>构建阶段>>将二进制文件与库链接>>向下滚动,单击“ +”号,然后从finder中添加库。

Links for creating static libraries and linking inside XCode Proj. 用于创建静态库和XCode Proj内部链接的链接。

1st Link 2nd Link 第一链接第二链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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