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

  • SEARCH
  • Home
  • 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 523419
In Process

The Archive Base Latest Questions

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

I’m encountering a very annoying error using Core Data on Mac OS X 10.5.

  • 0

I’m encountering a very annoying error using Core Data on Mac OS X 10.5.

All entities have classes in my application which share the same names.

Up to this point, I’ve done 5 migrations without problems.

I’m using the XML data store.
I’ve got V5 of my data model with 13 entities, 4 of which are abstract. It looks like this:
alt text http://synapticmishap.co.uk/ObjectModel.jpg

What I do

  1. Create a new version of my data
    model – this is V6.

  2. Add a new entity (JGToolbarWindow)
    and set the parent to JGWindowBase.

  3. Added a mapping model that goes from
    V5 to V6. Saved it.

  4. Set the current version to be V6.

  5. Build and Debug.

I’ve got automatic migration switched on in the Persistent Store Coordinator options dictionary.

The Problem

  1. Get an error – “Multiple validation
    errors occurred.”

  2. I’ve set a breakpoint and examined
    the validation errors. There’s a long
    list of validation errors – there
    seems to be one for every data entry.

  3. It seems that it’s stripping out ALL
    the relationships and since one of my
    properties – application – is set to
    be required, this counts as a
    validation error.

  4. So it seems the problem lies with the
    migration not being able to migrate
    the relationships… even though
    apparently nothing has changed as far
    as relationships go.

  5. When I look in ~/Library/Application
    Support/Name of my app/ I see an XML
    Data Store that’s got the same name
    appended by .xml.new When looking at
    this file in a text editor, all the
    relationships have indeed been
    stripped out.

What I’ve tried

  1. Creating a new XML data store and
    putting a handful of items in it,
    then trying again. I get the same
    errors for each item.

  2. Cleaning and rebuilding.

  3. Making sure the old .xml.new from
    previous validation has been
    deleted.

  4. Deleting the new model version and
    repeating my actions to make sure I
    didn’t screw something up.

  5. Adding mapping entries for each of
    the abstract classes, which are
    ignored by default. Added all
    attributes and relationships. Still
    exactly the same error.

  6. Tried adding a new entity that
    doesn’t have a class, just based on
    NSManagedObject which has
    JGWindowBase as a parent. Again,
    failed.

The only thing I can think that has changed is some of my internal logic in the classes underlying the model. But these are minor changes and I can’t understand how it was migrating fine, and now it’s not when nothing appears to have changed.

I’ve tried a brand new migration from a renamed latest data store and have exactly the same problems. Which means I’ve got to solve this problem for any data migration to work.

Errors

When I put a breakpoint at the presentError line below

if (![persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType
                                                  configuration:nil 
                                                            URL:url 
                                                        options:options 
                                                          error:&error]){
          [[NSApplication sharedApplication] presentError:error];
}

and examine the error userInfo, I get lots of errors like this:

Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x67ebfd0 "item is a required value."

po (NSArray *)0x67ebfd0

gives:

NSLocalizedDescription = "item is a required value.";
NSValidationErrorKey = item;
NSValidationErrorObject = <NSManagedObject: 0x45d5830> (entity: JGLogEntry; id: 0x4baccb0 <x-coredata://B597E13E-BE74-402E-BF00-5E1D57898406/JGLogEntry/p13942> ; data: {
duration = nil;
item = nil;                   // <<< Here's the problem.
processBundleID = nil;
processID = nil;
processName = nil;
startTime = 2009-10-09 16:41:44 +0100;
stopTime = 2009-10-09 16:42:17 +0100;
windowDocumentPathOrURL = nil;
windowID = nil;
windowTitle = nil;

All this really tells me is that it’s removed the relationship connected to item, which is a required property which is why it’s telling me there are validation errors. There are a whole load for application too, which is the other required property.

As I see it, the problem isn’t with the validation errors as such, it’s that it seems to be not migrating any relationships at all.

I’m pulling my hair out with this. I’d really, really appreciate some help. And finally, a Star Wars quote:

“Help me, Stack Overflow. You’re my
only hope.”

  • 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-13T08:27:37+00:00Added an answer on May 13, 2026 at 8:27 am

    Upgrade To Snow Leopard

    Snow Leopard seems to address this issue – I’ve not had any problems with migrating data since the upgrade.

    Alternatively, I suppose it may gone away because I switched to the SQLite data store, although I think it’s more likely that migrations with abstract objects are a bit broken on Leopard.

    • 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.