<i id='P2VaO'><tr id='P2VaO'><dt id='P2VaO'><q id='P2VaO'><span id='P2VaO'><b id='P2VaO'><form id='P2VaO'><ins id='P2VaO'></ins><ul id='P2VaO'></ul><sub id='P2VaO'></sub></form><legend id='P2VaO'></legend><bdo id='P2VaO'><pre id='P2VaO'><center id='P2VaO'></center></pre></bdo></b><th id='P2VaO'></th></span></q></dt></tr></i><div id='P2VaO'><tfoot id='P2VaO'></tfoot><dl id='P2VaO'><fieldset id='P2VaO'></fieldset></dl></div>
    1. <tfoot id='P2VaO'></tfoot>
        <bdo id='P2VaO'></bdo><ul id='P2VaO'></ul>

    2. <small id='P2VaO'></small><noframes id='P2VaO'>

      <legend id='P2VaO'><style id='P2VaO'><dir id='P2VaO'><q id='P2VaO'></q></dir></style></legend>

      iOS 如何使用私有 API?

      时间:2023-05-31

          • <bdo id='fggjN'></bdo><ul id='fggjN'></ul>
              <tbody id='fggjN'></tbody>
              <tfoot id='fggjN'></tfoot>
              <i id='fggjN'><tr id='fggjN'><dt id='fggjN'><q id='fggjN'><span id='fggjN'><b id='fggjN'><form id='fggjN'><ins id='fggjN'></ins><ul id='fggjN'></ul><sub id='fggjN'></sub></form><legend id='fggjN'></legend><bdo id='fggjN'><pre id='fggjN'><center id='fggjN'></center></pre></bdo></b><th id='fggjN'></th></span></q></dt></tr></i><div id='fggjN'><tfoot id='fggjN'></tfoot><dl id='fggjN'><fieldset id='fggjN'></fieldset></dl></div>

              <small id='fggjN'></small><noframes id='fggjN'>

              <legend id='fggjN'><style id='fggjN'><dir id='fggjN'><q id='fggjN'></q></dir></style></legend>

                本文介绍了iOS 如何使用私有 API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我不想将此应用提交到 AppStore.我已经尝试了很多次,但遇到了很多问题:(

                I don't want to submit this app to AppStore. I've tried for many times but met so many problems :(

                我使用 class-dump 来获取 UIKit.framework 的所有头文件.在class-dump生成的UIApplication.h中,看到了我要使用的方法----launchApplicationWithIdentifier.

                I use class-dump to get all the header files of UIKit.framework. In the UIApplication.h generated by class-dump, I saw the method I want to use----launchApplicationWithIdentifier.

                然后我将 UIApplication.h 放入我的项目中并导入它.编译,我得到了很多重新定义枚举器......"错误,因为在我之前使用的 UIKit.framework 中,还有另一个 UIApplication.h.但是这个文件没有launchApplicationWithIdentifier方法.

                Then I put UIApplication.h in my project and import it. Compile, I got a lot of "Redefinition of enumerator...." error because in the UIKit.framework I use previous, there's another UIApplication.h. But this file doesn't have the method launchApplicationWithIdentifier.

                如果我删除之前的 UIKit.framework 并导入 class-dump 生成的文件夹.然后它看起来像一个框架,但如果我展开它,它是空的.

                If I delete the previous UIKit.framework and import the folder generated by class-dump. Then it appears like a framework but if I unfold it, it's empty.

                然后我想让所有生成的头文件成为一个框架文件,替换之前的UIKit.framework.但我不知道怎么做.我们可以看到,在系统框架目录下,有一个与框架同名的文件,并且有一个已执行的shell脚本"图标.我怎样才能制作这个文件?

                Then I want to make all generated header files a framework file ant replace the previous UIKit.framework. But I don't know how. As we can see, under the system framework directory, there's a file which has the same name as the framework and has a 'executed shell script' icon. How can I made this file?

                我真的很困惑.有人可以帮我一把吗?谢谢.

                I really got confused. Someone can give me a hand? Thank you.

                推荐答案

                只要在你想使用的类实现上面的类别接口中指定私有方法,像这样:

                Just specify the private methods in a category interface above the class implementation where you want to use it, like this:

                @interface UIApplication (Private)
                
                - (BOOL)launchApplicationWithIdentifier:(id)identifier suspended:(BOOL)suspended;
                
                @end
                

                不要导入整个类转储文件并与原始 UIKit 框架链接.

                Don't import the whole class-dump file and link with the original UIKit framework.

                使用私有 API 时必须非常小心.这些方法可以在未来的 iOS 版本中更改或删除!

                You must be very careful when using private API. These methods can change or be removed in future iOS versions!

                在运行时用 respondsToSelector: 检查方法是否真的存在,并为它不存在的情况做好准备.

                Check if the method really exists with respondsToSelector: at runtime and be prepared for the case that it does not exist.

                我在自己的应用程序中使用了一个秘密的 MapKit 功能,并且我知道私有方法仅存在于 iOS 5 中.所以我的应用程序仍然适用于所有 iOS 版本,但此功能仅在 iOS 5 中可用(Apple 删除或更改了它在 iOS 6 beta 1) 中.

                I used a secret MapKit feature in my own application and I knew that the private methods only exist in iOS 5. So my app still works in all iOS versions but this feature is only available in iOS 5 (Apple removed or changed it in iOS 6 beta 1).

                这篇关于iOS 如何使用私有 API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:在 iOS 5.x 中增加 UITextView 中表情符号字符的字体 下一篇:URLForUbiquityContainerIdentifier: 应该在主线程之外的线

                相关文章

                最新文章

                <i id='n68L6'><tr id='n68L6'><dt id='n68L6'><q id='n68L6'><span id='n68L6'><b id='n68L6'><form id='n68L6'><ins id='n68L6'></ins><ul id='n68L6'></ul><sub id='n68L6'></sub></form><legend id='n68L6'></legend><bdo id='n68L6'><pre id='n68L6'><center id='n68L6'></center></pre></bdo></b><th id='n68L6'></th></span></q></dt></tr></i><div id='n68L6'><tfoot id='n68L6'></tfoot><dl id='n68L6'><fieldset id='n68L6'></fieldset></dl></div>

                  1. <tfoot id='n68L6'></tfoot>
                      <bdo id='n68L6'></bdo><ul id='n68L6'></ul>

                    <small id='n68L6'></small><noframes id='n68L6'>

                    <legend id='n68L6'><style id='n68L6'><dir id='n68L6'><q id='n68L6'></q></dir></style></legend>