您好,我使用这个 SQLCipher(http://sqlcipher.net/ios-tutorial/) 来加密我的 sqlite,但是当我编译时遇到了这个错误
"_sqlite3_key", referenced from:
-[LCAppDelegate application:didFinishLaunchingWithOptions:] in LCAppDelegate.o
Symbol(s) not found for architecture i386
当我在 AppDelegate 中使用此代码时发生这种情况
#import <sqlite3.h>
...
NSString *databasePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
stringByAppendingPathComponent: @"sqlcipher.db"];
sqlite3 *db;
if (sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK) {
const char* key = [@"BIGSecret" UTF8String];
sqlite3_key(db, key, strlen(key));
if (sqlite3_exec(db, (const char*) "SELECT count(*) FROM sqlite_master;", NULL, NULL, NULL) == SQLITE_OK) {
// password is correct, or, database has been initialized
} else {
// incorrect password!
}
sqlite3_close(db);
}
有人知道如何解决这个问题吗?请帮帮我!!!
Best Answer-推荐答案 strong>
你没有为 i386 编译它——看教程
将 i386 添加到有效的拱门和要构建的拱门中。
=> 只有 SIMULATOR 是 i386
关于ios - "_sqlite3_key"未找到架构 i386 的符号,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/22512614/
|