2010-01-29 3 views
2

핵심 데이터 모델을 업데이트/마이그레이션해야하는 응용 프로그램 업데이트를 App Store에 제출했습니다. 손으로 새로운 속성이 추가 된 단순한 변경 일 뿐이며 이름이 바뀌 었습니다. 대부분의 사용자에게는 괜찮은 것처럼 보였지만 이해할 수없는 2 가지 오류보고가있었습니다.핵심 데이터로 인해 마이그레이션하는 동안 응용 프로그램이 중단됨

자동 유추 마이그레이션을 수행하는 동안 충돌이 모두 발생하는 것 같습니다. 마이그레이션 옵션은 NSMigratePersistentStoresAutomaticallyOptionNSInferMappingModelAutomaticallyOption입니다.

누구든지 마이그레이션에 오래 걸리는 아이디어가 있습니까? 앱이 시작될 때마다 충돌을 일으켜 앱을 사용할 수 없게됩니다. 둘 다 iPhone OS 3.1.2를 실행하고 있습니다.

도움을 주시면 감사하겠습니다.

사용자 신고

com.foo.MyApp failed to launch in time 
elapsed total CPU time (seconds): 19.970 (user 14.130, system 5.840), 92% CPU 
elapsed application CPU time (seconds): 9.910, 45% CPU 

Thread 0: 
0 CoreData      0x00093d08 -[NSPersistentStoreCoordinator dealloc] + 0 
1 CoreFoundation     0x0003963a -[NSObject release] + 28 
2 CoreData      0x000b6e0e -[NSSQLiteInPlaceMigrationManager migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:] + 1470 
3 CoreData      0x000aceb0 -[NSStoreMigrationPolicy(InternalMethods) migrateStoreAtURL:toURL:storeType:options:withManager:error:] + 92 
4 CoreData      0x000ad6f0 -[NSStoreMigrationPolicy migrateStoreAtURL:withManager:metadata:options:error:] + 72 
5 CoreData      0x000ac9ee -[NSStoreMigrationPolicy(InternalMethods) _gatherDataAndPerformMigration:] + 880 
6 CoreData      0x0000965c -[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:] + 1328 

Unknown thread crashed with unknown flavor: 5, state_count: 1 

보고서 사용자 B

com.foo.MyApp failed to suspend in time 
elapsed total CPU time (seconds): 18.580 (user 13.320, system 5.260), 93% CPU 
elapsed application CPU time (seconds): 8.340, 42% CPU 

Thread 0: 
0 libsqlite3.dylib    0x00022f14 sqlite3_backup_init + 2396 
1 libsqlite3.dylib    0x00025474 sqlite3_backup_init + 11964 
2 libsqlite3.dylib    0x000255dc sqlite3_backup_init + 12324 
3 libsqlite3.dylib    0x0002aa74 sqlite3_open16 + 16084 
4 libsqlite3.dylib    0x00047838 sqlite3_prepare16 + 46920 
5 libsqlite3.dylib    0x00002940 sqlite3_step + 44 
6 CoreData      0x00011958 _execute + 44 
7 CoreData      0x000113e0 -[NSSQLiteConnection execute] + 696 
8 CoreData      0x000994be -[NSSQLConnection prepareAndExecuteSQLStatement:] + 26 
9 CoreData      0x000be14c -[_NSSQLiteStoreMigrator performMigration:] + 244 
10 CoreData      0x000b6c60 -[NSSQLiteInPlaceMigrationManager migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:] + 1040 
11 CoreData      0x000aceb0 -[NSStoreMigrationPolicy(InternalMethods) migrateStoreAtURL:toURL:storeType:options:withManager:error:] + 92 
12 CoreData      0x000ad6f0 -[NSStoreMigrationPolicy migrateStoreAtURL:withManager:metadata:options:error:] + 72 
13 CoreData      0x000ac9ee -[NSStoreMigrationPolicy(InternalMethods) _gatherDataAndPerformMigration:] + 880 
14 CoreData      0x0000965c -[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:] + 1328 

Unknown thread crashed with unknown flavor: 5, state_count: 1 

답변

9

첫 번째 줄은 무슨 일이 일어나고 있는지에 대한 사용자의 단서이다. 두 경우 모두 핵심 데이터 지속성/절약이 너무 오래 걸립니다. 응용 프로그램은 오류로 인해 충돌하지 않지만 OS가 종료되거나 적시에 시작하지 않기 때문에 OS에서 종료됩니다.

각 사용자의 데이터 세트의 크기는 어느 정도입니까? 크기가 매우 큰 경우 마이그레이션을 제어하고 백그라운드 스레드에 배치하거나 조각으로 분할하여 응용 프로그램을 제 시간에 시작할 수 있습니다.

종료 문제는 응용 프로그램이 실행되는 동안 증분 저장을 수행하지 않고 응용 프로그램이 종료 될 때 하나의 큰 저장을 수행한다는 것을 나타냅니다. 이론적으로 워크 플로에 논리적 인 중단이있을 때마다 응용 프로그램이 디스크에 저장해야합니다. 종료 종료 문제를 해결하거나 해결할 수 있도록 응용 프로그램에 저장 내용을 추가하는 경우

+0

답변 해 주셔서 감사합니다. 코어 데이터는 새로운 업그레이드 된 데이터베이스로 데이터를 생성하고 마이그레이션하는 데 너무 오래 걸렸습니다. 이는 데이터베이스 파일 크기가 크기 때문입니다. 결국 나는 응용 프로그램을 완전히 초기화하고 다음 실행 루프에서 직접 설정을 수행 할 수있었습니다. 완벽하게 작동합니다! –

관련 문제