CoreData questions: How to reset NSManagedObject, how to "Un-manage" an NSManagedObject.
CoreData questions: How to reset NSManagedObject, how to "Un-manage" an NSManagedObject.
- Subject: CoreData questions: How to reset NSManagedObject, how to "Un-manage" an NSManagedObject.
- From: Motti Shneor <email@hidden>
- Date: Wed, 23 Mar 2011 09:21:42 +0200
Hi.
1. When you create an NSManagedObject, it is initialized with default values defined in the model. How can I reset an existing NSManagedObject to these default values?
2. We have a multithreaded application, and we only keep one core-data context. Our network-related code receives data in a background thread, but is unable to write it to the model directly. So it saves it in some intermediate data object, and passes it to the main-thread for writing into the model.
I would like to use an NSManagedObject to replace the intermediate data object --- It is quite ugly to have duplicated model classes definition for everything. My question:
Can I somehow detach an NSManagedObject from its context, and use it in an "Unmanaged" way?
Hopefully I can later attach it to the context, or create another NSManagedOBject from its data?
Motti Shneor,
Spectrum Reflections LTD.
---
ceterum censeo microsoftiem delendam esse
---
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden