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 3227590
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:35:34+00:00 2026-05-17T16:35:34+00:00

I have a fairly simply schema. Essentially, Run <–> Data (where a Run holds

  • 0

I have a fairly simply schema. Essentially, Run <–> Data (where a Run holds a data, e.g., Temperature, sampled from some sort of sensor).

Now, it seems that sensors can have more than one measurement (e.g., Temperature and Humidity). So, a single Run could have multiple data samples.

Hence, Run <–>> Sample and Sample <–> Data. (And for simplicity I am leaving Run <–> Data in place, for now.)

If I create a new mapping model, then things generally work – except that no new Samples are created, no relationships are established between Runs and Samples nor between Samples and Datas.

I am trying to get mapping model to migrate my model but even the slightest change to the generated mapping model results in Cocoa error 134110.

For example, if I take the “Sample” mapping (which has no Source) and set its Source to ‘Run’ (so that I can set Sample’s inverse relationship ‘run’ appropriately) then the mapping changes its name to “RunToSample”. There are two relationships handled in this mapping: data and run. The data property gets set automatically to

FUNCTION($manager, "destinationInstancesForEntityMappingNamed:sourceInstances:" , "DataToData", $source.dataSet)

Following this example, I set the run property to

FUNCTION($manager, "destinationInstancesForEntityMappingNamed:sourceInstances:" , "RunToRun", $source)

Similarly, I set the ‘sample’ property mapping in RunToRun to

FUNCTION($manager, "destinationInstancesForEntityMappingNamed:sourceInstances:" , "RunToSample", $source)

and the ‘sample’ property in DataToData to

FUNCTION($manager, "destinationInstancesForEntityMappingNamed:sourceInstances:" , "RunToSample", $source.run)

So, what, I wonder, is going wrong? I have tried various permutations, such as leaving the ‘inverse’ relationships unspecified. But I continue to get the same error (134110) regardless.

I imagine that this is a lot easier than it seems and that I am missing some fundamental but minor piece. I have also tried subclassing NSEntityMigrationPolicy and overriding -createDestinationInstancesForSourceInstance: but these efforts have met with much the same results.

Thanks in advance for any pointers or (relevant 🙂 advice.

Edit: For simplicity, I have marked all relationships as optional. Though, ultimately, I may choose otherwise.

  • 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-17T16:35:34+00:00Added an answer on May 17, 2026 at 4:35 pm

    Using the following, I was able to get a better understanding of what was going on (and going wrong):

            NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"MyDataStore.sqlite"]];
    
        NSError *error = nil;
        NSDictionary *sourceMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType
                                                                        URL:storeUrl
                                                                        error:&error];
    
        if (!sourceMetadata)
            {
            DLog(@"sourceMetadata is nil");
            }
        else
            {
            DLog(@"sourceMetadata is %@", sourceMetadata);
            }
    

    In addition, I needed to carefully order my entity mappings. And, I found that -[NSMigrationManager destinationInstancesForEntityMappingNamed:sourceInstances:] was absolutely necessary for copying ‘relationships’. For example,

        NSSet *runs = [source valueForKey:@"allRuns"];
    for (Run *srcRun in runs)
        {
        NSArray *temp = [manager destinationInstancesForEntityMappingNamed:@"RunToRun"
                                    sourceInstances:[NSArray arrayWithObject:srcRun]];
        if ([temp count])
            {
            Run *dstRun = (Run*)[temp lastObject];
            [dest addAllRunsObject:dstRun];
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple const struct in some C code that simply holds
I have a following fairly simple scenario: Some data needs to be written into
I have a fairly simple table called widgets. Each row holds an id, a
I have a fairly simple application using Core Data, and a couple Array Controllers
I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and
I have a fairly simple addition to the HTTP standard. An ambitious goal I
I have a fairly simple sync problem. I have a table with about 10
Let's say I have a fairly simple app that lets users store information on
I have the following (fairly) simple JavaScript snippet that I have wired into Greasemonkey.
We have fairly large C++ application which is composed of about 60 projects in

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.