Core Data relationship Many-To One

59 views Asked by At

I have a TableView in which I am showing saved data from CoreData (UserDocuments File).

If the user clicks on a document it pops to FinalView in which he can change the name of image or share it.

But I have one button which opens camera and captures image; I want to save this new image with the old one. So like indexPath of the image was 5 and new image should be saved inside indexPath 5, so in tableView if document is single go back to FinalView as I have now, and if the document has two or more images go to the new UITableView.

How to save image as single document and as multiply document?

1

There are 1 answers

0
zzzz On BEST ANSWER

As in my project i needed to store the data at first time i have saved it in my FinalView but as my relationship required i needed a new image which will be the content of the first image so from FinalView i made popToRooTViewController because my CameraView was root. With delegate method i transfer data from CameraView to FinalImage, then my view opens tableView where i represent first side of content but it opens the indexPath in which i should save the new Entity as Relationship. so i use MagicalRecord in my application and it helped me.