Stable way to embed open-source code into static library in iOS?

本秂侑毒 提交于 2019-12-02 20:29:36

问题


I'm making a static library for distribution for other developers. In other words, a kind of API.

And I have to use bunch of open-source libraries like SBJSON, ASIHTTPRequest. I think it'll make an name conflict problem if I embed these classes into my library at source level. As I know, Objective-C runtime doesn't support private classes.

So it there a way to include those classes into my library without name conflict?


回答1:


Just don't!

Simply tell your users that they shall link SBJSON or ASIHTTP into their app to get your stuff working. That is the way those issues should be handled. There is nothing wrong in having a dependency in your library. Solving this by refactoring a standard library (e.g. renaming SBJSON classes) is NOT a way to go.



来源:https://stackoverflow.com/questions/8149005/stable-way-to-embed-open-source-code-into-static-library-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!