【发布时间】:2015-10-26 09:30:00
【问题描述】:
我想加密一个 xml 文件。我正在尝试关注此链接strong-encryption-for-cocoa-cocoa-touch
NSError *error = nil;
if (![[NSFileManager defaultManager] AESEncryptFile:@"/path/to/input file" toFile:@"/path/to/output file" usingPassphrase:@"My secret password" error:&error])
{
NSLog(@"Failed to write encrypted file. Error = %@", [[error userInfo] objectForKey:AESEncryptionErrorDescriptionKey]);
}
在输入代码时出现此错误:
“NSFileManager”没有可见的@interface 声明选择器“AESEncryptFile:toFile:usingPassphrase:error:”
我已包含在标题中
#include <CommonCrypto/CommonCryptor.h>
我该如何克服这个错误?我是否错过了包含或声明某些内容?
【问题讨论】:
标签: ios objective-c cocoa nsfilemanager