core data - Is this database lost ? DBData is corrupted. SQLite error code:26, 'file is encrypted or is not a database' -


after copying file external drive local hard drive, got error , can't anymore open it:

coredata: error: (26) fatal error.  database @ bddata corrupted.  sqlite error code:26, 'file encrypted or not database'  error: file couldn’t opened because isn’t in correct format. 

is there can it?

a reason didn't copy sqlite journal files. recent versions of ios , mac os x sqlite uses wal style journaling. when wal used there multiple files-- primary sqlite file , 2 others same name -wal , -shm added. if don't copy everything, don't useable sqlite file.

if that's not case, file may corrupt. don't know why-- "manually copied operating system" mean? file on ios or os x? did drag 1 finder window another?

if you're planning on copying core data store files this, it's best change journal mode delete, eliminates need copy files. you'd including journal mode 1 of options when adding persistent store:

nsmutabledictionary *storeoptions = [nsmutabledictionary dictionary]; [storeoptions setobject:@{ @"journal_mode": @"delete" } forkey:nssqlitepragmasoption]; // add other options 

then use options parameter when calling addpersistentstorewithtype:configuration:url:options:error:.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -