Loading Entities from a CoreData document
Loading Entities from a CoreData document
- Subject: Loading Entities from a CoreData document
- From: David Zwerdling <email@hidden>
- Date: Thu, 16 Apr 2009 22:04:33 -0700
Dear List,
A while ago I wrote a simple application in which users create and
manipulate CoreData entities named "DataSets". Simple enough. I used
the document preset so I didn't have to deal with any of the file
writing stuff.
Anyways, I'm writing a new application that uses these data sets.
Users save the file from the prior application and can "import" data
sets into this new application. At least, hypothetically at this
point. The issue is, when using code like this (url points to a
document full of data sets):
NSPersistentDocument *pd = [NSPersistentDocument new];
BOOL success = [pd configurePersistentStoreCoordinatorForURL:url
ofType:NSXMLStoreType modelConfiguration:nil storeOptions:nil
error:&error];
NSSet *ros = [[pd managedObjectContext] registeredObjects];
success comes back true, but there are no managed objects in 'ros'.
So, is there some sample code I can see which loads the managed
objects of an xml file? I've looked pretty exhaustively and
everything seems too high level (relying on the single-file model that
I implemented in my original application.) Am I missing something
silly?
Thanks in advance,
Dave
_______________________________________________
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