简体   繁体   English

具有第三方静态库和框架的Cocoa Touch框架

[英]Cocoa Touch Framework with third-party static libraries and frameworks

I'm developing a Cocoa Touch Framework which is used a couple of third-party static libraries and frameworks. 我正在开发一个Cocoa Touch框架,该框架使用了几个第三方静态库和框架。 For some of them I have a source code. 对于其中的一些我有源代码。 For others I'm don't. 对于其他人,我不是。 The issue is when someone who uses my framework wants to use the same third-party static libraries and frameworks, he will encounter with console logs like: 问题是,当使用我的框架的人想要使用相同的第三方静态库和框架时,他将遇到控制台日志,例如:

Class <ClassName> is implemented in both <Path to my framework> and <Path to my app>. One of the two will be used. Which one is undefined.

My framework is written on Objective-C. 我的框架是用Objective-C编写的。

How can I completely hide third-party libraries and frameworks inside my own dynamic framework so that developers who are using my framework also can use the same third-party static libraries and frameworks without any conflicts? 如何将第三方库和框架完全隐藏在自己的动态框架中,以便正在使用我的框架的开发人员也可以使用相同的第三方静态库和框架而不会发生任何冲突?

The error that you are seeing in the log is the result of you compiling the source files of the third-party library for both your framework's target and your app's target. 您在日志中看到的错误是为框架目标和应用程序目标编译第三方库的源文件的结果。 You'll most likely see the source files in the Compile Sources build phase for both targets. 您很可能会在“ Compile Sources构建阶段看到两个目标的源文件。

To fix this, remove the files from the app's Compile Sources build phase, as it is unnecessary to have them there. 要解决此问题,请从应用程序的“ Compile Sources构建阶段中删除文件,因为没有必要在此处放置文件。 It is not necessary to link/compile libraries for your app that have already been linked/compiled into your framework. 不必为已链接/编译到框架中的应用程序链接/编译库。

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

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