Re: ... loading XML store type into in-memory store...
Re: ... loading XML store type into in-memory store...
- Subject: Re: ... loading XML store type into in-memory store...
- From: William Bumgarner <email@hidden>
- Date: Tue, 11 Apr 2006 08:58:01 -0700
On Apr 10, 2006, at 10:05 PM, Peter Sampson wrote:
I want to load some external data from a server source and load it
to a local store. I have control on both ends.
Right now, I am trying to load the keys/values from a property list
using setValuesForKeysWithDictionary: (the dataset size is small)
I tried pointing the persistentStoreCooridator to
URLWithString:@"http://url",
but that doesn't work.
Essentially, I'm trying to take the simplest route possible,
without having to iterate through values, etc.
Any suggestions?
Sure.
- As you have discovered, the persistent store coordinator only takes
file:// URLs. So, you will need to download the data to the local
disk first.
- Is the data at that URL really an XML store as saved by Core
Data? I ask the obvious as some folks have been under the mistaken
impression that "XML Store" means "any random XML document".
If it is an XML store, then you could use NSURL to download the data
and add the resulting file as an XML store to a persistent store
coordinator instance.
If not, you will need to write the code necessary to walk the XML
document and produce the appropriate Core Data entity instances. In
this case, an in-memory store is certainly appropriate assuming said
data never needs to be persisted to disk locally. This will require
traversing the document (the DOM) and turning it into a Core Data
object model.
b.bum
_______________________________________________
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