简体   繁体   中英

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. 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.

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.

To fix this, remove the files from the app's Compile Sources build phase, as it is unnecessary to have them there. It is not necessary to link/compile libraries for your app that have already been linked/compiled into your framework.

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