ios - 将 RNCryptor 导入项目

标签 ios objective-c encryption aes xcode7

我尝试将 RNCryptor 导入到我的项目中以加密某些字符串。但我很难理解如何将其导入到我的 Objective-C 项目中。我通过拖放到我的项目中来复制 RNCryptor/RNCryptor.swiftRNCryptor.h。然后它“创建了一个桥接头”。之后我尝试调试,但收到 38 条错误消息,例如:使用无法解析的标识符“kCCKeySizeAES256”使用无法解析的标识符“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/

相关文章:

ios - 容器 Controller 和 iOS 6 轮换

javascript - 用Javascript模拟touchmove惯性

ios - 如何在不丢失其缩放属性的情况下裁剪 UIImage?

objective-c - 每个 NSThread 是否自动分配一个调度队列?

Objective-C 枚举在 Swift 中不可见

c++ - 修改程序以加密大写和小写输入

objective-c - 如何在工具栏中间添加超大按钮

ios - 当我在 animationDidStart : 中设置结束值时,CABasicAnimation 不插值

c++旋转加密

Java 解密 - 使用填充密码解密时输入长度必须是 8 的倍数