My app has a collection view of folders (with bunch o images data in them) and when one is selected it performs a segue to another collections view to show the images "contained" in that folder. In core data I have two entities: folder and picture. I also have one to-many relationship from folder to picture called "pictures" and a reverse to-one relationship called "folder"
My solution is to pass the indexpath of the folder in the "performSegue" method to the second collection view controller. Then in 2nd collection view cotroller I fetch the folder record with that indexpath and use its relationship to get the images...However I am not sure that is the way..
What is the best way to get the images in the second collection view controller ?
Thx
If the instance of folder
is already in your master view controller, then pass it directly to the detail view controller, instead of making a second request to core data. Because, passing the path to the index of a table would require you to also have access to this table from the detail view controller, which would result in creating a dependency between both controllers while there must be no such dependency.