gpt4 book ai didi

ios - 错误: No such function: sqlcipher_export on iOS

转载 作者:行者123 更新时间:2023-11-29 05:56:22 26 4
gpt4 key购买 nike

我已经通过 pod 安装了 SQLCipher。但我收到此错误,提示没有此类函数:sqlcipher_export。我使用的是 FMDB,对于 SQLCipher 我使用的是它的子规范,即 FMDB/sqlcipher。我已经添加了

#import <SQLCipher/sqlite3.h>

下面是我的代码:

NSString *docsDir;
NSArray *dirPaths;
dirPaths = NSSearchPathForDirectoriesInDomains
(NSApplicationSupportDirectory, NSUserDomainMask, YES);
docsDir = dirPaths[0];

databasePath = [[NSString alloc] initWithString:[docsDir stringByAppendingPathComponent: @"MyDB.db"]];

NSString *encryptDB = [docsDir stringByAppendingPathComponent:@"MyDB_enc.db"];

const char* sqlQ = [[NSString stringWithFormat:@"ATTACH DATABASE '%@' AS MyDB_enc KEY 'test123';",encryptDB] UTF8String];

//sqlite3 *unencrypted_DB;

if (sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {

// Attach empty encrypted database to unencrypted database
sqlite3_exec(database, sqlQ, NULL, NULL, NULL);

// export database
sqlite3_exec(database, "SELECT sqlcipher_export('MyDB_enc');", NULL, NULL, NULL); //gives error

// Detach encrypted database
sqlite3_exec(database, "DETACH DATABASE MyDB_enc;", NULL, NULL, NULL);

sqlite3_close(database);
}
else {
sqlite3_close(database);
NSAssert1(NO, @"Failed to open database with message '%s'.", sqlite3_errmsg(database));
}

databasePath = [docsDir stringByAppendingPathComponent:@"MyDB_enc.db"];

谁能指导我如何解决这个问题

最佳答案

我在安装 POD 时遇到了这个问题,但是当我在编译二进制文件后使用 sqlite3.h 文件时,它工作正常。

关于ios - 错误: No such function: sqlcipher_export on iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55114929/

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