Sample of Program Downloading XML using NSXMLParser to CoreData
Any sample projects?
That say I can download or at least read
I think the basic should be check the entities, have a bunch of propert开发者_运维知识库ies indicating currentElement currentChildElement, and then add stuffs out. But I like to see sample code
I've created a project like this and I didn't find any sample projects or tutorials. In fact, I don't think I really stepped out of Apple's own docs for this one. The key is to break down the task into its basic components. So, going by your title of Program Downloading XML using NSXMLParser to CoreData
, break that down into
- Downloading content—in this case a text file
- Parsing the downloaded content as XML with
NSXMLParser
- Populating Core Data (hint: you do this while parsing)
There are tutorials out there, if not related questions and answers here in SO (I know for a fact I answered a question about how to use NSXMLParser
), that will tell you how to do each of those things, but the particulars of how they work together quickly become specific to your project.
It looks as though you are on the right track with some of your comments, so I suggest you keep going down the path you are on and see how it goes. When you come up with a specific problem related to your project, then come back here and see where there is an answer.
精彩评论