Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

crash on coredata ios8

Tags:

I have a crash on CoreData when I save :

2014-09-16 09:51:58.273 My_app[2678:105246] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString appendString:]: nil argument'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001087413f5 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001083dabb7 objc_exception_throw + 45
    2   CoreFoundation                      0x000000010874132d +[NSException raise:format:] + 205
    3   CoreFoundation                      0x000000010871274f mutateError + 159
    4   CoreData                            0x000000010672ae56 -[_NSSQLGenerator prepareMasterReorderStatementPart2ForRelationship:] + 118
    5   CoreData                            0x0000000106792fd8 -[NSSQLAdapter newCorrelationMasterReorderStatementPart2ForRelationship:] + 72
    6   CoreData                            0x00000001067a9751 -[NSSQLiteConnection writeCorrelationMasterReordersFromTracker:] + 817
    7   CoreData                            0x00000001067aa061 -[NSSQLiteConnection writeCorrelationChangesFromTracker:] + 65
    8   CoreData                            0x000000010679c617 -[NSSQLCore writeChanges] + 1351
    9   CoreData                            0x00000001066dfadf -[NSSQLCore saveChanges:] + 479
    10  CoreData                            0x00000001066b0ee4 -[NSSQLCore executeRequest:withContext:error:] + 484
    11  CoreData                            0x00000001067868f2 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 4354
    12  CoreData                            0x000000010678e7ee gutsOfBlockToNSPersistentStoreCoordinatorPerform + 190
    13  libdispatch.dylib                   0x00000001091e27f4 _dispatch_client_callout + 8
    14  libdispatch.dylib                   0x00000001091c9848 _dispatch_barrier_sync_f_invoke + 365
    15  CoreData                            0x00000001067813d5 _perform + 197
    16  CoreData                            0x00000001066b0ac8 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 504
    17  CoreData                            0x00000001066d9d2d -[NSManagedObjectContext save:] + 1213

The same code works in ios7.

Is there someone who has the same crash ?

like image 596
Antoine Avatar asked Sep 16 '14 08:09

Antoine


1 Answers

Just to summarize the comments that helped me resolve this issue:

  • This seems to be a bug in Core Data related to Ordered Many-to-Many Relationships
  • If you have to keep the ordered option, there seems to be a workaround: make the relationship ordered both ways (thanks @Fabio Ritrovato).
like image 73
knl Avatar answered Sep 20 '22 15:09

knl