views:

85

answers:

1

What is the right way to build iPhone core data for this SMS like app (with location)?
- I want to represent an entity of
conversation with
"profile1"
"profile2"
that heritage from a profile entity,
and a message entity with:
"to"
"from"
"body"
where the "to" and "from" are equal to "profile1" and/or "profile2" in the conversation entity.
How can I make such a relationships?
is there a better way to represent the data (other structure)?
Thanks

A: 

UPDATED

What you describe makes sense.

Create Profile, Conversation, and Message entities.

Conversations should have to-one relationships to Profile for both "to" and "from" (the inverse relationships for each will be to-many) and a to-many relationship with Message (the inverse relationship will be to-one).

gerry3
Thanks, but i want Profile->conversation->messages hierarchy.. so the "to" and "from" (and "body")are in the msg entity..I can't figure out how to make it to relationship or "heritage" from the conversation "profile1,profile2".. any idea?
Boaz
I updated my answer to fix my mistake and add the Conversation entity. I am not sure what you are having trouble with.
gerry3