Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ... loading XML store type into in-memory store...



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: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >... loading XML store type into in-memory store... (From: Peter Sampson <email@hidden>)
 >Re: ... loading XML store type into in-memory store... (From: William Bumgarner <email@hidden>)
 >Re: ... loading XML store type into in-memory store... (From: Peter Sampson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.