Re: Core Data Conundrum
Re: Core Data Conundrum
- Subject: Re: Core Data Conundrum
- From: Charlie Dickman <email@hidden>
- Date: Sat, 12 Dec 2009 19:43:02 -0500
Rick,
This can be done in a straightforward manner using C structures that contain pointers to the C structures.
For example, you can define structures
typedef node _node {
segment *someSegment;
}
typedef struct _segment {
node node1;
node node2;
}
set node.segment to nil in the last segment and chain them together. Remember to malloc each instance and free them when they are no longer needed.
This model can easily be transmogrified into Objective C objects.
On Dec 12, 2009, at 7:30 PM, Rick Mann wrote:
> Hi. I'm trying to set up a model for a Node and a Segment. A Segment exists between Nodes. Each Segment has a node1 and node2 attribute, and each Node can have multiple Segments. I don't seem to be able to model this relationship; I can have either node1 with an inverse of segments, or node 2, but not both.
>
> It's important for me to distinguish which end of a segment a particular Node is associated with (imagine drawing a directed arrow). I feel like this should be straightforward, but I'm stuck.
>
> Any suggestions?
>
> TIA,
> Rick
>
> _______________________________________________
>
> 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
Charlie Dickman
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