Manually loading into a Core Data model
Manually loading into a Core Data model
- Subject: Manually loading into a Core Data model
- From: Karl Moskowski <email@hidden>
- Date: Mon, 20 Nov 2006 19:01:32 -0500
Hi all,
I'm writing an app where I present data from a third-party XML file.
I've got a method to manually load the XML file into managed objects,
I've wired up the UI with Cocoa bindings and controllers, and I've
temporarily bound it to a button for testing. It all seems to work.
However, I'd like it to load automatically at application launch, so
I'm thinking of triggering the load in the app delegate's
applicationDidFinishLaunching method. Also, since I don't have to
manipulate or save the loaded data, I'd like to suppress the
automatic saving of the store to disk when the app quits, i.e., I'd
like to reload it from the source XML file every time; for this, I'm
using a subclass of NSManagedObjectContext, and I've overridden the
save method to do nothing, and it seems to work.
My question is, are these the right places to do these things? Is
there a better place than applicationDidFinishLaunching to load the
XML into the model? Is there a more appropriate way to make the
entire store non-persistent between launches?
Thanks.
--Karl <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden