• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data: Cross-model relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: Cross-model relationships


  • Subject: Re: Core Data: Cross-model relationships
  • From: Ian Joyner <email@hidden>
  • Date: Mon, 15 Oct 2007 16:39:46 +1000

Since no one has had a go at this one, I'll assume that the answer is no, you cannot set up cross-model relationships (or fetched properties) in Xcode modeller.

I think the way to do it is in code setting up a new NSFetchedPropertyDescription with an appropriate NSFetchRequest. Should know more tomorrow about how this works.

Thanks
Ian

On 12/10/2007, at 4:40 PM, Ian Joyner wrote:

I have some entities in my application that are global (like preferences), and remain the same across application runs. These can be referred to by entities that are specific to each stored document. Thus I have a model which has a list of states that entities in each separate document can be in. There is also a document model, which describes the specific entities stored in each document.

Thus the entities in the document model refer to the state entities in the preferences model. Now I can't use a relationship, because Core Data does not support cross-store relationships. So I'm trying to use a Fetched Property with a Fetch Request to define a weak cross-store (and therefore cross-model) relationship.

Is this theoretically possible?

When I setup a fetched property for state in my document entity (in Xcode modeller) it needs the destination set – however, the destination popup only shows entities in the current model. What I want (I think) is a predicate something like:

State.id == $FETCH_SOURCE.state_id

in order to relate the document entity to the globally defined state entity in the other model.

If this isn't possible to setup in Xcode, can I do it programmatically?

Thanks

Ian
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
40sportstec.com


This email sent to email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Core Data: Cross-model relationships (From: Ian Joyner <email@hidden>)

  • Prev by Date: Re: Pasting NSImage problems
  • Next by Date: Re: Core Data: Cross-model relationships
  • Previous by thread: Core Data: Cross-model relationships
  • Next by thread: Re: Core Data: Cross-model relationships
  • Index(es):
    • Date
    • Thread