iPhone - Core Data crash on migration
- by Sergey Zenchenko
I have problems, when i install app from Xcode all works but if I build app and install it from iTunes I have an error with the database at launch.
This happens only than i have changes in the core data model and need to migrate to a new version.
At first launch at crashes with message:
Thread 0:
0 libSystem.B.dylib 0x00034588 pwrite + 20
1 libsqlite3.dylib 0x000505ec _sqlite3_purgeEligiblePagerCacheMemory + 2808
2 libsqlite3.dylib 0x000243d8 sqlite3_backup_init + 7712
3 libsqlite3.dylib 0x000244ac sqlite3_backup_init + 7924
4 libsqlite3.dylib 0x0000d418 sqlite3_file_control + 4028
5 libsqlite3.dylib 0x000228b4 sqlite3_backup_init + 764
6 libsqlite3.dylib 0x00022dd0 sqlite3_backup_init + 2072
7 libsqlite3.dylib 0x000249a8 sqlite3_backup_init + 9200
8 libsqlite3.dylib 0x00029800 sqlite3_open16 + 11360
9 libsqlite3.dylib 0x0002a200 sqlite3_open16 + 13920
10 libsqlite3.dylib 0x0002ab84 sqlite3_open16 + 16356
11 libsqlite3.dylib 0x00049418 sqlite3_prepare16 + 54056
12 libsqlite3.dylib 0x00002940 sqlite3_step + 44
13 CoreData 0x00011958 _execute + 44
14 CoreData 0x000113e0 -[NSSQLiteConnection execute] + 696
15 CoreData 0x000994be -[NSSQLConnection prepareAndExecuteSQLStatement:] + 26
16 CoreData 0x000be14c -[_NSSQLiteStoreMigrator performMigration:] + 244
17 CoreData 0x000b6c60 -[NSSQLiteInPlaceMigrationManager migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:] + 1040
18 CoreData 0x000aceb0 -[NSStoreMigrationPolicy(InternalMethods) migrateStoreAtURL:toURL:storeType:options:withManager:error:] + 92
19 CoreData 0x000ad6f0 -[NSStoreMigrationPolicy migrateStoreAtURL:withManager:metadata:options:error:] + 72
20 CoreData 0x000ac9ee -[NSStoreMigrationPolicy(InternalMethods) _gatherDataAndPerformMigration:] + 880
21 CoreData 0x0000965c -[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:] + 1328
At next launches app doesn't loads data from database.