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

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

      <tfoot id='wowNf'></tfoot>

        <bdo id='wowNf'></bdo><ul id='wowNf'></ul>
    2. <legend id='wowNf'><style id='wowNf'><dir id='wowNf'><q id='wowNf'></q></dir></style></legend>
    3. iOS - 将框架故事板链接到 ViewController 以在主项目中使用

      时间:2023-05-19
      <tfoot id='Uewdb'></tfoot>

        1. <legend id='Uewdb'><style id='Uewdb'><dir id='Uewdb'><q id='Uewdb'></q></dir></style></legend>
            <tbody id='Uewdb'></tbody>

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

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

                <bdo id='Uewdb'></bdo><ul id='Uewdb'></ul>
                本文介绍了iOS - 将框架故事板链接到 ViewController 以在主项目中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我正在尝试在我的主项目中完成并使用故事板,该项目是在框架中创建的.这是为了在未来的众多不同项目中使用该框架.

                I am attempting to pull through and use a storyboard in my main project which is being created in a framework. This is to use the framework in a multitude of different projects going forward.

                我已经使用捆绑包将故事板提供给主项目,并且在构建应用程序时可以看到它.然而,同样位于框架内的附加 ViewController 在运行时不会链接.框架中的所有类都被导入到主项目中.

                I have managed, using a bundle, to feed the storyboard through to the main project and I can see it when I build the app. However the appending ViewController, also sitting within the framework, does not link during runtime. All the classes in the framework are being imported to the main project.

                错误消息说它找不到视图控制器.

                The error message says that it cannot find the view controller.

                我尝试将视图控制器添加到包中,但它不喜欢这样,因为它不允许 .h 文件进入包中.我还尝试反转依赖关系,使框架成为捆绑包的依赖关系(认为它会导致其中的所有类,包括我的视图控制器,首先加载).

                I have attempted adding the view controller to the bundle, however it does not like this as it will not allow the .h file into a bundle. I have also tried inverting the dependencies so the framework become a dependency of the bundle (thinking was that it would cause all the classes therein, inc my viewcontroller, to load first).

                有没有人遇到过这种情况?非常感谢您提出修复建议!

                Has anyone encountered this before? I would much appreciate suggestions for a fix!!

                谢谢,克里斯

                推荐答案

                要让它找到关联的视图控制器,你只需要在你的应用程序中使用 -all_load -ObjC Other Linker Flags in Build设置.

                To get it to find the view controller associated, all you need is -all_load -ObjC in your apps Other Linker Flags in Build Settings.

                由于应用程序代码实际上并未使用或引用 ViewController,链接器似乎遗漏了必要的文件,因此链接器只是将其遗漏了.这会强制它在现在链接时使用 ViewController.(看看 这个答案更详细)

                it seems the linker leaves out the files necessary due to the apps code not actually using or referencing the ViewController, so the linker just leaves it out. This forces it to use the ViewController when linking now. (have a look at this answer for more detail)

                我只是将我的框架故事板与我的框架捆绑在一起,我遵循了 本指南 了解如何为框架制作捆绑包

                i did this with just having my frameworks storyboard in a bundle along side my framework, i followed this guide for finding out how to make the bundle for the framework

                这篇关于iOS - 将框架故事板链接到 ViewController 以在主项目中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:签署嵌入式框架在 Xcode 11.2.1 中不起作用 下一篇:Xcode 4 和嵌套项目——找不到头文件

                相关文章

                <tfoot id='wQX6n'></tfoot>

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

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

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