سؤال

I simply want to create entities yet not to be saved, only inspect them.

Can I create a temporary context for those? Is there a way to move them into the persistent context once I decided to store them?

And the point: are these features available trough MagicalRecord API?

هل كانت مفيدة؟

المحلول

Create a new NSManagedContext that has parentContext property set to your main context, and create new objects in the new context - you can do everything you want with those objects, then later either save the new context (this will move the objects to the main context) or just discard it - the objects will be gone.

Seems that there stands an +(NSManagedObjectContext*)MR_contextWithParent: for that in MagicalRecord.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top