user1078065
user1078065

Reputation: 412

ios Core Data: How to change NSManagedObject without saving it to the context

i have let's say a NsMutableArray called "mArray" with fetched results from from a core data context. So, "mArray" contains some NSManagedObjects.

At some point i have to make some editing on those objects.

At a further point i will have to add some new NSManagedObjects to the context, also needing to save the context.

Now the new objects are save, but also the above editing on those objects are saved.

I woud like to be able to save only the new added NSManagedObjects to the context without the edits.

Can someone point me in the correct directions?

Thanks

Upvotes: 0

Views: 785

Answers (1)

Jody Hagins
Jody Hagins

Reputation: 28409

When you save a context, you save everything in it. If you want to work with some objects that do not save at the same time as other objects, you need to use multiple contexts.

See the documentation on NSManagedObjectContext, because using multiple contexts is not the easiest thing in the world.

Upvotes: 1

Related Questions