La première version de notre application se trouve dans l'App Store. Afin d'internationaliser l'application, un changement mineur a été apporté au modèle de données de base utilisé par l'application, le changement étant - un nouvel attribut ajouté à l'une des entités.L'application iPhone se bloque avec l'erreur coreData
J'ai effectué la modification en ajoutant un nouveau modèle de gestion des versions aux données de base et en définissant le Core DataModel actuel sur cette nouvelle version créée.
Pour effectuer une migration légère, j'ai ajouté les options requises ainsi comme ceci:
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
NSError *error = nil;
__persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
[__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error];
Tout cela fonctionne très bien lors des essais dans le simulateur et les essais sur l'appareil (lorsqu'il est connecté à MAC) . Une fois que j'ai fait un fichier ipa et l'ai installé sur l'appareil, l'application se bloque dès que je le lance. Le fichier default.png apparaît et aucune autre vue n'est chargée.
Le journal des pannes de l'application montre un problème avec CoreData, mais je ne suis pas en mesure de mettre un doigt et dire que c'est ce qui a causé le problème. Le journal de l'accident se présente comme ci-dessous:
Last Exception Backtrace:
0 CoreFoundation 0x374f388f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x31568259 objc_exception_throw + 33
2 CoreData 0x324ee491 -[NSManagedObjectModel(_NSInternalMethods) _setIsEditable:] + 1
3 Company 0x000dfe7f 0xde000 + 7807
4 Company 0x000dfc91 0xde000 + 7313
5 Company 0x000ecb5b 0xde000 + 60251
6 Company 0x000ec8a3 0xde000 + 59555
7 Company 0x000ec82b 0xde000 + 59435
8 Company 0x000eb61d 0xde000 + 54813
9 UIKit 0x3080cd59 -[UIViewController awakeFromNib] + 113
10 UIKit 0x3089f207 -[UINib instantiateWithOwner:options:] + 1243
11 UIKit 0x308a0861 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 137
12 UIKit 0x307d6385 -[UIApplication _loadMainNibFileNamed:bundle:] + 37
13 UIKit 0x3065f6eb -[UIApplication _loadMainInterfaceFile] + 223
14 UIKit 0x3065972f -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 235
15 UIKit 0x30627ac3 -[UIApplication handleEvent:withNewEvent:] + 1011
16 UIKit 0x30627567 -[UIApplication sendEvent:] + 55
17 UIKit 0x30626f3b _UIApplicationHandleEvent + 5827
18 GraphicsServices 0x3764322b PurpleEventCallback + 883
19 CoreFoundation 0x374c7523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
20 CoreFoundation 0x374c74c5 __CFRunLoopDoSource1 + 141
21 CoreFoundation 0x374c6313 __CFRunLoopRun + 1371
22 CoreFoundation 0x374494a5 CFRunLoopRunSpecific + 301
23 CoreFoundation 0x3744936d CFRunLoopRunInMode + 105
24 UIKit 0x3065886b -[UIApplication _run] + 551
25 UIKit 0x30655cd5 UIApplicationMain + 1081
26 Company 0x000df5df 0xde000 + 5599
27 Company 0x000df598 0xde000 + 5528
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3289832c __pthread_kill + 8
1 libsystem_c.dylib 0x34c0d208 pthread_kill + 48
2 libsystem_c.dylib 0x34c06298 abort + 88
3 libc++abi.dylib 0x3221bf64 abort_message + 40
4 libc++abi.dylib 0x32219346 _ZL17default_terminatev + 18
5 libobjc.A.dylib 0x31568350 _objc_terminate + 140
6 libc++abi.dylib 0x322193be _ZL19safe_handler_callerPFvvE + 70
7 libc++abi.dylib 0x3221944a std::terminate() + 14
8 libc++abi.dylib 0x3221a81e __cxa_rethrow + 82
9 libobjc.A.dylib 0x315682a2 objc_exception_rethrow + 6
10 CoreFoundation 0x37449506 CFRunLoopRunSpecific + 398
11 CoreFoundation 0x37449366 CFRunLoopRunInMode + 98
12 UIKit 0x30658864 -[UIApplication _run] + 544
13 UIKit 0x30655cce UIApplicationMain + 1074
14 Company 0x000df5d8 0xde000 + 5592
15 Company 0x000df590 0xde000 + 5520
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x328883a8 kevent + 24
1 libdispatch.dylib 0x346a5f04 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x346a5c22 _dispatch_mgr_thread + 30
Thread 2:
0 libsystem_kernel.dylib 0x32898cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x34bc8f36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x34bc8cc8 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x32898cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x34bc8f36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x34bc8cc8 start_wqthread + 0
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x328980d8 __psynch_mutexwait + 24
1 libsystem_c.dylib 0x34bc2674 pthread_mutex_lock + 376
2 WebCore 0x336994e8 _ZL17_WebTryThreadLockb + 208
3 WebCore 0x336997ec _ZL14WebRunLoopLockP19__CFRunLoopObservermPv + 24
4 CoreFoundation 0x374c7b14 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
5 CoreFoundation 0x374c5d50 __CFRunLoopDoObservers + 252
6 CoreFoundation 0x374c616a __CFRunLoopRun + 946
7 CoreFoundation 0x3744949e CFRunLoopRunSpecific + 294
8 CoreFoundation 0x37449366 CFRunLoopRunInMode + 98
9 WebCore 0x3373cc9c _ZL12RunWebThreadPv + 396
10 libsystem_c.dylib 0x34bce72e _pthread_start + 314
11 libsystem_c.dylib 0x34bce5e8 thread_start + 0
Thread 5:
0 libsystem_kernel.dylib 0x32898cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x34bc8f36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x34bc8cc8 start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000
r4: 0x00000006 r5: 0x3f18dd98 r6: 0x00000002 r7: 0x2fedca68
r8: 0x0c641d30 r9: 0x00000000 r10: 0x0c63fd00 r11: 0x3fae9728
ip: 0x00000148 sp: 0x2fedca5c lr: 0x34c0d20f pc: 0x3289832c
CPSR: 0x000f0010
La ligne
"2 CoreData 0x324ee491 -[NSManagedObjectModel(_NSInternalMethods) _setIsEditable:] + 1"
indique un problème avec les données de base, mais je ne sais pas quoi, ni ce que je dois faire pour répare ça. Une idée?
Il s'agit d'une projection 'NSException'. Il aurait dû afficher un message d'erreur en anglais correct, pourriez-vous s'il vous plaît le partager? –
Où vais-je voir l'exception en anglais? Je ne vois pas cette exception lors de l'exécution de l'application sur le simulateur ou sur un périphérique connecté à XCode. Cette erreur se produit uniquement lorsque j'installe le fichier .ipa sur mon périphérique et tout ce que je reçois est le journal des pannes. - Merci – EmmKay
Le fichier ipa a été construit en utilisant un script de construction et cela a été causé par une erreur de construction. Le fichier .ipa construit n'incluait pas la deuxième version des données de base. Donc, l'application s'est toujours écrasée. – EmmKay