I have two entities: Item and Note.

assign the relationship when I save
Item *item = [NSEntityDescription insertNewObjectForEntityForName:@"Item"
inManagedObjectContext:self.managedObjectContext];
Note *note = [NSEntityDescription insertNewObjectForEntityForName:@"Note"
inManagedObjectContext:self.managedObjectContext];
note.noteText = @"test";
[note setInItem:item]; //set relationship??
[self.managedObjectContext save:nil]; // write to database
When I load the data, Item attributes are loaded, but I do not know how to load the note.noteText for this item.
self.itemNameTextField.text = self.item.name;
...
...
self.itemNoteTextField.text = ????????????
Thanks!
If
itemis an Item object thenitem.containNoteis the set of all related Note objects. You can iterate over the notes with