gpt4 book ai didi

ios - 导入 RNCryptor 到项目

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:56:10 27 4
gpt4 key购买 nike

我尝试将 RNCryptor 导入我的项目以加密一些字符串。但是我很难理解如何将其导入到我的 objective-c 项目中。我通过拖放到我的项目中复制了 RNCryptor/RNCryptor.swiftRNCryptor.h。然后它“创建了一个桥接头”。之后我尝试调试,但出现 38 条错误消息,例如:Use of unresolved identifier 'kCCKeySizeAES256'Use of unresolved identifier 'CCPBKDFAlgorithm'。我该如何解决这个问题以及如何在 viewController.h 文件中使用它?通常使用 #import "RNCryptor.h"

https://github.com/RNCryptor/RNCryptor#obj-c

最佳答案

我认为您需要将 #import "RNCryptor/RNCryptor.h" 添加到桥接头文件中,您这样做了吗?

参见 RNCryptor Swift branch

The Bridging Header

CommonCrypto is not a modular header in Xcode 7. This makes it very challenging to import into Swift. To work around this, the necessary header files have been copied into RNCryptor.h, which needs to be bridged into Swift. You can do this either by using RNCryptor as a framework, adding #import "RNCryptor/RNCryptor.h" to your existing bridging header, or making RNCryptor/RNCryptor.h your bridging header in Build Settings, "Objective-C Bridging Header."

关于ios - 导入 RNCryptor 到项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34249377/

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