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 protected])
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/3tothe4th%40comcast.net
>
> This email sent to [email protected]
Charlie Dickman
[email protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]