gpt4 book ai didi

ios - 如何在 swift 框架中使用 Objective C 桥接头?

转载 作者:行者123 更新时间:2023-11-30 11:47:22 25 4
gpt4 key购买 nike

我在 swift 中创建了自己的 cocoa POD 框架,它使用 #import CommonCrypto/CommonCrypto.h在 Objective C 桥接头文件中,但是当我尝试在项目中使用相同的 POD 时,它会给出编译错误 -

Include of non-modular header inside framework module '': '/Users/macmini/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/CommonCrypto/CommonCrypto.h'"

请告诉我如何解决这个问题。

我正在使用它在 swift 中创建我自己的 POD 框架。

最佳答案

转到项目目标 -> build设置 -> 搜索“模块” ->将“允许非模块化包含在框架模块中”设置为"is"。

这将允许您在项目中使用 Objective C 桥接头文件。

关于ios - 如何在 swift 框架中使用 Objective C 桥接头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48677464/

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