xcode iOS 私有框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9171160/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS Private Frameworks
提问by jkigel
I'm trying to use Private Frameworks in my project, The problem is when I add the .framework file to the project, there is no header file
我试图在我的项目中使用私有框架,问题是当我将 .framework 文件添加到项目时,没有头文件
Any solution for that?
有什么解决办法吗?
Thanks!
谢谢!
回答by rob mayoff
What BJ Homer said is correct: private frameworks are for Apple's use only, so there's no reason why they would ship the headers.
BJ Homer 所说的是正确的:私有框架仅供 Apple 使用,因此他们没有理由发布标头。
That said, if you want to walk on the wild side, and you don't want to submit your app to the app store, you can try using class-dump
to create headers based on the library file in the framework. This won't generate the real headers that Apple uses - you just get the method signatures. You don't get any constants or C functions, and you certainly don't get any informative comments. Any private frameworks you do use will probably change in the next release of iOS, breaking your app.
就是说,如果你想在野蛮的一面走,又不想把你的应用提交到应用商店,你可以尝试使用class-dump
框架中的库文件来创建头文件。这不会生成 Apple 使用的真实标头 - 您只会获得方法签名。您不会得到任何常量或 C 函数,当然也不会得到任何有用的注释。您使用的任何私有框架可能会在下一个 iOS 版本中更改,从而破坏您的应用程序。
回答by nst
You can browse and search the private (and public) headers https://github.com/nst/iOS-Runtime-Headersgenerated dynamically by iOS Runtime Browser https://github.com/nst/RuntimeBrowser/.
您可以浏览和搜索的私有(公共)头https://github.com/nst/iOS-Runtime-Headers通过iOS的浏览器运行时动态生成https://github.com/nst/RuntimeBrowser/。
回答by BJ Homer
That's precisely why they're labeled "Private"; they don't want other people using them, and thus have not included the headers.
这正是它们被贴上“私人”标签的原因;他们不希望其他人使用它们,因此没有包含标题。