Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have the same issue. It works for smaller data sets, but for larger sets I get "_referenceData64 only defined for abstract class" errors. There's no abstract entities in my model. </p> <p>EDIT:</p> <p>I think I got this resolved. The issue in my case was a confusion on my part re threads. Here's the guidelines I followed to fix it:</p> <ol> <li>I parse XML data in a thread. On launching said thread, create a new NSManagedObjectContext using the same persistent store coordinator as your main thread's NSManagedObjectContext.</li> <li>Any new objects you make in your thread should be made for the thread's NSManagedObjectContext. If you have to copy over objects from the main thread's NSManagedObjectContext, copy over by ID. I.e.<br> <code>NSManagedObjectID *objectID = [foo objectID];<br> FooClass *newFoo = [(FooClass*)[threadManagedObjectContext objectWithID:objectID] retain]</code></li> <li>When finished parsing, you need to save the changes made to the thread's NSManagedObjectContext. You must lock the persistent store coordinator. I used the following (incomplete code): </li> </ol> <p>`</p> <pre><code> - (void)onFinishParsing { // lock the store we share with main thread's context [persistentStoreCoordinator lock]; // save any changes, observe it so we can trigger merge with the actual context @try { [threadManagedObjectContext processPendingChanges]; } @catch (NSException * e) { DLog(@"%@", [e description]); [persistentStoreCoordinator unlock]; } @finally { // pass } NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter]; [dnc addObserver:self selector:@selector(threadControllerContextDidSave:) name:NSManagedObjectContextDidSaveNotification object:threadManagedObjectContext]; @try { NSError *error; if (![threadManagedObjectContext save:&amp;error]) { DLog(@"%@", [error localizedDescription]); [persistentStoreCoordinator unlock]; [self performSelectorOnMainThread:@selector(handleSaveError:) withObject:nil waitUntilDone:NO]; } } @catch (NSException *e) { DLog(@"%@", [e description]); [persistentStoreCoordinator unlock]; } @finally { // pass } [dnc removeObserver:self name:NSManagedObjectContextDidSaveNotification object:threadManagedObjectContext]; [self performSelectorOnMainThread:@selector(parserFinished:) withObject:nil waitUntilDone:NO]; } // Merging changes causes the fetched results controller to update its results - (void)threadControllerContextDidSave:(NSNotification*)saveNotification { // need to unlock before we let main thread merge [persistentStoreCoordinator unlock]; [self performSelectorOnMainThread:@selector(mergeToMainContext:) withObject:saveNotification waitUntilDone:YES]; } - (void)mergeToMainContext:(NSNotification*)saveNotification { NSError *error; [managedObjectContext mergeChangesFromContextDidSaveNotification:saveNotification]; if (![managedObjectContext save:&amp;error]) { DLog(@"%@", [error localizedDescription]); [self handleSaveError:nil]; } } </code></pre> <p>`</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload