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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:17:57+00:00 2026-05-12T22:17:57+00:00

My Core Data model contains an entity, Shape, that has two self-referential relationships, which

  • 0

My Core Data model contains an entity, Shape, that has two self-referential relationships, which means four properties. One pair is a one-to-many relationship (Shape.containedBy <->> Shape.contains) and the another is a many-to-many relationship (Shape.nextShapes <<->> Shape.previousShapes). It all works perfectly in the application, so I don’t think self-referencing relationships is a problem in general.

However, when it comes to migrating the model to a new version, then Xcode fails to compile the automatically generated mapping model, with this error message:

2009-10-30 17:10:09.387 mapc[18619:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "FUNCTION($manager ,'destinationInstancesForSourceRelationshipNamed:sourceInstances:' , 'contains' , $source.contains) == 1"'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00007fff80d735a4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x00007fff83f0a313 objc_exception_throw + 45
    2   Foundation                          0x00007fff819bc8d4 _qfqp2_performParsing + 8412
    3   Foundation                          0x00007fff819ba79d +[NSPredicate predicateWithFormat:arguments:] + 59
    4   Foundation                          0x00007fff81a482ef +[NSExpression expressionWithFormat:arguments:] + 68
    5   Foundation                          0x00007fff81a48843 +[NSExpression expressionWithFormat:] + 155
    6   XDBase                              0x0000000100038e94 -[XDDevRelationshipMapping valueExpressionAsString] + 260
    7   XDBase                              0x000000010003ae5c -[XDMappingCompilerSupport generateCompileResultForMappingModel:] + 2828
    8   XDBase                              0x000000010003b135 -[XDMappingCompilerSupport compileSourcePath:options:] + 309
    9   mapc                                0x0000000100001a1c 0x0 + 4294973980
    10  mapc                                0x0000000100001794 0x0 + 4294973332
)
terminate called after throwing an instance of 'NSException'
Command /Developer/usr/bin/mapc failed with exit code 6

The ‘contains’ is the name of one of the self-referential properties. Anyway, the really big problem is that I can’t even look at this Mapping Property as Xcode crashes as soon as I select the entity mapping when viewing the mapping model. So I’m a bit lost really where to go from here. I really can’t remove the self-referential properties, so I’m thinking I’ve got manually create a mapping model that compiles? Any ideas?

Cheers

  • 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-12T22:17:57+00:00Added an answer on May 12, 2026 at 10:17 pm

    Okay, so it seems as though “contains” might be a reserved word, and as such needs to be escaped using a “#”. The Apple docs on migration don’t specifically mentions it as a reserved word, although they also don’t say what the definitive list is.

    But, it seems that a property name cannot be the same as any NSObject or NSManagedObject method name, such as “description”, and apparently “contains”.

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

Sidebar

Ask A Question

Stats

  • Questions 216k
  • Answers 216k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'd recommend an arduino Arduino is an open-source electronics prototyping… May 12, 2026 at 11:08 pm
  • Editorial Team
    Editorial Team added an answer If you're looking to avoid running the Map step each… May 12, 2026 at 11:08 pm
  • Editorial Team
    Editorial Team added an answer Using asynchronous ajax you need to do something like: function… May 12, 2026 at 11:08 pm

Related Questions

I have a Core Data model setup like so: Blockbuster Entity To-Many relationship to
In my Core Data managed object model, I have an entity Foo with a
I am making an app that parses feeds from xml and stores them using
I'm new to Cocoa programming, and decided for my first project to create a
A bit cryptic, which is also what drives me to start a thread in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.