tags:

views:

53

answers:

1

I would like to use Core Data Managed Objects outside of a managed object context. I've seen other threads on this site that say you should never do this, but here's my issue:

I have a 'Feed' object and a 'story' object. Feed is like an RSS feed, and story is like a single story from that feed. I have the ability to bookmark feeds, and I use Core Data to persist those, but I when I download stories from a feed, I don't want to insert those stories into the managed object context. The only way to create my objects, however, is by doing this:

[NSEntityDescription insertNewObjectForEntityForName:name inManagedObjectContext:managedObjectContext];

Which means that it will be persisted at the next save event.

I don't want these objects to be persisted until the user selects them.

I tried defining a "TransientStory" and a "PersistentStory" with a protocol called "Story" that both of them implement, but it's a nightmare. Any ideas?

A: 

I tried to create plain NSObject classes which mimic the NSManagedObject classes, and then I passed the variables from the NSManagedObject instance to the NSObject instance, but I still could not get it to work.

cannyboy