开发者

core-data relationships and data structure

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/开发者_Go百科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


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜