First of all, I love the book, and it’s been a big help, but I’ve come across a use case for Core Data which I can’t seem to work out the best-practice implementation for, and would appreciate some advice on it:
My app systematically generates a number of NSManagedObjects and presents a list of them to the user, who then has the option to mark any of these as ‘favorites’, thereby saving them for later. The rest are good to be forgotten when the app closes.
Using a child context to store the full set of ‘short-term’ objects seems like the way to go, but how would I go about saving just the user-selected ones from the child context back to the parent? I know that generally when the child context saves, all of its content shifts up to the parent. Is there a way to move specific objects from one context to another that wouldn’t be too much of a hack?
Any advice is appreciated. Perhaps someone else has experienced the same need?