iphone - Core Data: Returning to a Previously Inserted Managed Object -


i have following model:

doctor <-->> case <->> report 

a doctor has many cases case has 1 doctor. case can has many reports

i generated classes representing model, , inserted 1 doctor, 1 case 1 report.

how can return doctor , associate case , same report?

any example one-to-many core data insertion , display.

best regards

when insert managed object pointer object back. assuming have nsmanagedobject subclass of doctor, create new doctor object this:

doctor *newdoc=[nsentitydescription insertnewobjectforentityforname:@"doctor"                                                 inmanagedobjectcontext:mymanagedobjectcontext]; 

newdoc pointer doctor object , can treat other object. can retain reference way e.g. instance attribute, array, set etc. can retrieve , add new case object so:

[newdoc addcaseobject:anewcase]; 

...and same add report case. these methods defined in autogenerated subclasses.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -