I have been trying to get a master detail application working for too long. I've tried many things and nothing really seems to work. Part of my problem is that I don't know the best way to go about it.
I have a core data model created and I can add master items. I have a detail view in a tab view that should display the detail items for the global selected master (optional value on environment object data).
The questions I have are:
What is the best way to do a detail view with a list? Iterate over the master object's list of detail items or use a fetch request with a predicate for the master? The first way kinda seems to work but the list doesn't get updated when items are deleted. It's not clear to me how to do the predicates for the fetch request so I haven't figured that out yet.
When deleting detail items, how is this done? Do you delete from the master and then save? Do you delete the detail items and let core data take care of the master? Is there some other way?
Does anybody know of a decent example of this kind of thing. All the examples I found either don't do editing, don't use core data, etc.
I'm not posting code because I'm trying to figure out best practices and what is recommended by Apple.
Thanks.
3
0
2.5k