database - core data inverse relationship ios -


just wanted know how create inverse relationship 1 side being to-one relationship , other side being to-many relationship. senario creating chat messenger have "contact" entity , "message" entity. now, want relationship message-->contact should to-one relationship while contact-->message should to-many relationship 1 contact can have multiple message. how set this? have added screenshot data modal. please have , let me know. p2pchat chatmessage class , contact contacts class.

enter image description here enter image description here enter image description here

  1. in data model need add relationships contact , messages message , contact entities respectively.

  2. select inverse relationship of messages contact. (or set inverse of of contact relationship message, either way work.) enter image description here

  3. select messages relationship on contact entity. change 'type' 'to many'.

enter image description here


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -