开发者

core-data relationships and data structure

开发者 https://www.devze.com 2022-12-25 15:22 出处:网络
What is the right way to build iPhone core data for this SMS like app (with location)? - I want to represent an entity of

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

精彩评论

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