views:

45

answers:

1

I have a user interface where the user can check off a bunch of items from a tableview, almost like a todo list. The items are populated from a Core Data stack.

I need to be able to take all of the items they're clicking through and put them into a "temporary" shopping cart. Once they're in the shopping cart, users can go through the list and remove the items, or just submit them to a server. The thing is, the selected items are temporary just like an internet based shopping cart. It's nothing something that gets persisted once the application closes. Once the view is no longer in display, I can assume that the shopping cart is safe to discard.

What's the best way to approach this? Since the user is essentially clicking on instances that map back to a Core Data entity .. should I setup a different persistence store such as in memory and add that store to my managed object context?

+2  A: 

You can make a NSMutableArray for the shopping cart, and just add and remove the Core Data objects to/from that array.

Jaanus
Agreed, this is not something that Core Data will solve or make easier. Just an array is all you need.
Marcus S. Zarra