Core Data, Threads and Document based app
Core Data, Threads and Document based app
- Subject: Core Data, Threads and Document based app
- From: "Thomas T" <email@hidden>
- Date: Fri, 11 Apr 2008 08:37:43 +0200
Hello
I am writing a document based core data app where I delegate som work
to an NSOperation subclass. This subclass should download stuff from
the internet and then create managed objects.
In my non-document based apps I have handled multithreading with a
separate NSManagedObjectContext for each thread.
I suppose I should do something similar in this app. But then a
problem arises....
The document is not necessarily saved when my download operation begins. So ..
- How can I create objects in my nsoperation when I don't have a
persistent store yet. I really couldn't ask the user to save the
document before beginning the download.
- In document based apps - how should I create my second
NSManagedObject context for use in my nsoperation?
One possible solution (or workaround) is to just have my operation
download the data from the internet but have my main thread handle the
managed object creation. But that doesn't seem clean to me.
regards,
Thomas T.
_______________________________________________
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