Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 541279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:19:37+00:00 2026-05-13T10:19:37+00:00

I’m doing an iPhone app that reads data from XML file, turn them into

  • 0

I’m doing an iPhone app that reads data from XML file, turn them into Core Data Managed Objects and save them.

The application is working fine, mostly, on smaller data set/XML that contains ~150 objects. I said mostly because 10% of the time, I’d get the following exception from CoreData while trying to save the context:

* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘* -_referenceData64 only defined for abstract class. Define -[NSTemporaryObjectID_default _referenceData64]!’

On a bigger data set (~2000), this happens every time, but not on the same place. It could fail on the 137th record, 580th, or the very last one. I’ve tried moving the save point (per object, per 10 objects, save once all objects are alloc/init’ed) but I always hit the exception above.

I’ve googled the exception and saw someone having the same issues but didn’t see any resolutions.

My next step was going to be simplifying the managed objects and relationships to a point where this error stops and build from there to isolate the issue. The last resort is to ditch Core Data and just directly store into sqllite.

Thanks for all your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:19:38+00:00Added an answer on May 13, 2026 at 10:19 am

    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.

    EDIT:

    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:

    1. 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.
    2. 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.
      NSManagedObjectID *objectID = [foo objectID];
      FooClass *newFoo = [(FooClass*)[threadManagedObjectContext objectWithID:objectID] retain]
    3. 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):

    `

     - (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:&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:&error]) {  
        DLog(@"%@", [error localizedDescription]);  
        [self handleSaveError:nil];  
      }  
    }  
    

    `

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.