gpt4 book ai didi

ios - 自定义框架导入 iOS

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:38:49 25 4
gpt4 key购买 nike

所以我有一个为我的 iOS 应用程序创建的自定义框架,它运行良好,但导入的工作方式与 Apple 包含的框架不同,我想知道为什么/如何修复它。

例子

#import <UIKit/UIKit.h> //Apple
#import "MyFramework.framework/Headers/MyFramework.h" //Me

期望:

#import "MyFramework/MyFramework.h"

最佳答案

来自 Apple documentation :

If your project links to frameworks that are not included in any of the standard locations, you must explicitly specify the location of that framework before Xcode can locate its header files. To specify the location of such a framework, add the directory containing the framework to the “Framework Search Paths” option of your Xcode project. Xcode passes this list of directories to the compiler and linker, which both use the list to search for the framework resources.

您可以在目标/build设置中设置框架搜索路径:

Target / Build Settings / Framework Search Paths

之后您应该能够使用标准 <MyFramework/MyFramework.h> 导入您的框架。符号。

关于ios - 自定义框架导入 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24875460/

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