Phew, sorry for the long title.
I have a single Managed Object Context where I am storing songs derived from two different locations. I get some of the songs from the persistent storage on the phone (using Core Data), and I pull some of the songs from an online database. Both of the songs are of the same MananagedObject subclass. I would like both of these songs to be in a single context because I would like them both to show up on a table view connected with an NSFetchedResultsController.
The problem occurs when I would like to save one of the songs. I don't want to save all of the songs that I pulled from the online database to the phone. I just want to save the single song, so a simple [moc save] doesn't work. The other issue is that after I save the single song, I still want the songs pulled from online to be in the context (but again, not saved). I believe I have a couple of different options:
1) Is it possible to have an NSFetchedResults controller connected to multiple contexts?
2) I could move all of the songs pulled from the online database into a separate temporary context, save in the original context, and then move all of the songs back. (see: How do I copy or move an NSManagedObject from one context to another?)
3) Remember all of the key-value pairs for the online songs, delete the online songs from the context, save the original context, insert all of the online songs back into the original context based off of the saved key-value pairs.
4) I am a huge n00b and am missing something easier.
Thanks!