简体   繁体   English

Xcode如何在另一个项目中添加静态库项目?

[英]Xcode how to add a static library project in another project?

i have an 2 XCode iphone projects. 我有一个2 XCode iphone项目。 1 creates a static library. 1创建一个静态库。 i want to use that static library in my other project. 我想在我的其他项目中使用该静态库。

how to attach that static library project with my other project. 如何将静态库项目与我的其他项目相关联。 so that when i compile my other project it will automatically compile the static library project and use that library. 因此,当我编译我的其他项目时,它将自动编译静态库项目并使用该库。

how to do this ? 这该怎么做 ?

It's quite simple : 这很简单:

First you need to drag the static library project file (xcodeproj) into your project to make a cross-project reference. 首先,您需要将静态库项目文件(xcodeproj)拖到项目中以进行跨项目引用。

Then you need to add the static library target as a dependency of your application app : go into the "Link Binary With Libraries" build phase of your application target and drag the static library target into it. 然后,您需要添加静态库目标作为应用程序应用程序的依赖项:进入应用程序目标的“Link Binary With Libraries”构建阶段,并将静态库目标拖入其中。

You can find an example of this process with the GData API : http://code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibrary 您可以使用GData API找到此过程的示例: http//code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibrary

(under the "Linking to the iPhone Static Library" section) (在“链接到iPhone静态库”部分下)

Hope this helps, Vincent. 希望这有帮助,文森特。

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

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