Iphone 我可以连接到远程sqlite二进制转储文件吗?
我尝试连接到远程sqlite文件,当我尝试打开该文件时,我收到一个错误:Iphone 我可以连接到远程sqlite二进制转储文件吗?,iphone,ipad,sqlite,mysqldump,Iphone,Ipad,Sqlite,Mysqldump,我尝试连接到远程sqlite文件,当我尝试打开该文件时,我收到一个错误: if (sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { ... }else { // Even though the open failed, call close to properly clean up resources. sqlite3_close(database); NSAssert1(0,
if (sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {
...
}else {
// Even though the open failed, call close to properly clean up resources.
sqlite3_close(database);
NSAssert1(0, @"Failed to open database with message '%s'.", sqlite3_errmsg(database));
// Additional error handling, as appropriate...
}
当我试图输出数据库路径时,它给出了正确的url,这是一个本地网络设置,应用程序连接到一个静态ip,搜索二进制sqlite转储
2010-04-27 12:47:43.017 bbc_v1[4904:207]加载数据库路径:
已测试,并且文件存在
是否可以连接到远程sqlite文件?还是只有在应用程序包中才有可能实现
欢迎,Thomassqlite3\u open接受文件名,而不是URL 我认为sqlite不提供任何远程访问,因为它是为嵌入式使用而明确设计的
您应该下载文件并将其保存在设备上,然后打开它。您不想打开应用程序包中的SQL文件。你只能读,不能写。通常,您会在第一次启动时将DB从应用程序包复制到Documents目录,然后从那里打开它。