<bdo id='UL1PE'></bdo><ul id='UL1PE'></ul>
  • <tfoot id='UL1PE'></tfoot><legend id='UL1PE'><style id='UL1PE'><dir id='UL1PE'><q id='UL1PE'></q></dir></style></legend>

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

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

      1. 我可以在另一个框架中包含一个框架吗?

        时间:2023-05-17

      2. <legend id='PQe7V'><style id='PQe7V'><dir id='PQe7V'><q id='PQe7V'></q></dir></style></legend>

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

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

          <tfoot id='PQe7V'></tfoot>

                <tbody id='PQe7V'></tbody>

                  本文介绍了我可以在另一个框架中包含一个框架吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在编写一个框架(称为 Lighthouse.framework),该框架又使用来自另一个框架(准确地说是 RegexKit.framework)的代码.我已将 RegexKit.framework 复制到我自己的框架中,使其具有如下结构:

                  I'm writing a framework (called Lighthouse.framework) that, in turn, uses code from another framework (RegexKit.framework, to be precise). I have copied RegexKit.framework into my own framework, so that it has a structure like the following:

                  Lighthouse.framework/
                    Versions/
                      A/
                        Frameworks/
                          RegexKit.framework
                        Lighthouse
                  

                  但是,当我尝试运行使用 Lighthouse.framework(我的框架)的应用程序时,我收到以下错误:

                  However, when I try to run an application that uses Lighthouse.framework (my framework), I get the following error:

                  dyld:库未加载:@executable_path/../Frameworks/RegexKit.framework/Versions/A/RegexKit

                  dyld: Library not loaded: @executable_path/../Frameworks/RegexKit.framework/Versions/A/RegexKit

                  引用自:/Users/mdippery/Developer/Projects/Current/lighthouse/build/Debug/Lighthouse.framework/Versions/A/Lighthouse

                  Referenced from: /Users/mdippery/Developer/Projects/Current/lighthouse/build/Debug/Lighthouse.framework/Versions/A/Lighthouse

                  原因:图片未找到

                  显然,加载程序没有找到 RegexKit.

                  Obviously, the loader isn't finding RegexKit.

                  这是加载器期望加载的路径,由 otool 提供:

                  Here're the paths the loader expects to load, courtesy otool:

                  build/Debug/Lighthouse.framework/Versions/A/Lighthouse:
                      /Users/mdippery/Library/Frameworks/Lighthouse.framework/Versions/A/Lighthouse (compatibility version 1.0.0, current version 1.0.0)
                      /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
                      @executable_path/../Frameworks/RegexKit.framework/Versions/A/RegexKit (compatibility version 0.4.0, current version 0.6.0)
                      /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
                      /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
                      /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
                      /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.19.0)
                      /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.26.0)
                  

                  我可以在另一个框架中包含一个框架吗?这是正确的方法吗?如何解决我的错误?

                  Can I include a framework in another framework? Is this the proper way to do it? How can I resolve my error?

                  推荐答案

                  我找到了解决这个问题的方法.我从 sbooth 的回答中吸收了一些想法,但修复更简单.我运行了这个脚本:

                  I discovered a fix for this problem. I incorporated some ideas from sbooth's answer, but the fix was simpler. I ran this script:

                  install_name_tool -change @executable_path/../Frameworks/RegexKit.framework/Versions/A/RegexKit @loader_path/Frameworks/RegexKit.framework/Versions/A/RegexKit "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.framework/Versions/A/${PRODUCT_NAME}"
                  

                  作为运行构建脚本阶段.

                  as a Run Build Script phase.

                  注意,对于一般情况,您必须将@executable_path/../更改为@loader_path/,一切正常.

                  Note that, for the general case, you have to change @executable_path/../ to @loader_path/, and all is well.

                  这篇关于我可以在另一个框架中包含一个框架吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:未找到自动链接框架 下一篇:Xcode6 创建 Fat 静态库 iOS 通用框架

                  相关文章

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

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

                    <legend id='a8ncd'><style id='a8ncd'><dir id='a8ncd'><q id='a8ncd'></q></dir></style></legend>
                      <bdo id='a8ncd'></bdo><ul id='a8ncd'></ul>
                  2. <tfoot id='a8ncd'></tfoot>