gpt4 book ai didi

objective-c - cocoa 框架 : Using one framework inside of another

转载 作者:行者123 更新时间:2023-12-03 16:32:33 27 4
gpt4 key购买 nike

我正在构建一个使用另一个框架(子)的框架(主)。主框架将在不同的应用程序中使用。主框架目标构建没有错误。但是,如果我尝试构建一个使用主框架的应用程序,我会收到错误 -> 主框架中的类无法找到/导入子框架...如何配置主框架才能找到子框架?

最佳答案

据我了解,您想在另一个框架中创建一个框架。它被称为“伞框架”,这不是一个好主意。

文档说:

Don't Create Umbrella Frameworks

While it is possible to create umbrella frameworks using Xcode, doing so is unnecessary for most developers and is not recommended. Apple uses umbrella frameworks to mask some of the interdependencies between libraries in the operating system. In nearly all cases, you should be able to include your code in a single, standard framework bundle. Alternatively, if your code was sufficiently modular, you could create multiple frameworks, but in that case, the dependencies between modules would be minimal or nonexistent and should not warrant the creation of an umbrella for them.

您可以在另一个框架中使用一个框架,但这两个框架都必须包含在您的应用程序目标中,并且必须复制到应用程序包的/Contents/Frameworks/目录中。此外,您还必须将两个框架的安装目录设置为@executable_path/../Frameworks

关于objective-c - cocoa 框架 : Using one framework inside of another,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11974906/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com