PDA

View Full Version : Help with Parsing




jpmcgrath
Jul 18, 2011, 11:45 PM
I have an XML document that has names, addresses, and phone numbers in it. I want to load the names in a table, but then set up contact cards without making more than two interface files. Is there a simple way to do this?

Thanks in advance, I'm new to dev.



chown33
Jul 19, 2011, 09:53 AM
iOS gives you an NSXMLParser class. Read its class reference (http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSXMLParser_Class/Reference/Reference.html) doc, and look at the sample code linked from there.

If you can't figure it out from that, then you're probably in over your head. You should then stop writing your current app, and go learn the fundamentals first.

You can't hop in the cockpit of an F-18 and fly it with no training or practice. You can't write apps without training or practice, either.

seepel
Jul 23, 2011, 01:03 AM
iOS gives you an NSXMLParser class. Read its class reference (http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSXMLParser_Class/Reference/Reference.html) doc, and look at the sample code linked from there.

If you can't figure it out from that, then you're probably in over your head. You should then stop writing your current app, and go learn the fundamentals first.

You can't hop in the cockpit of an F-18 and fly it with no training or practice. You can't write apps without training or practice, either.

And if you are not in over your head, NSXMLParser is a SAX type parser, but I believe there are a few DOM style third party parsers out there (quick Google search will surely provide them). So if the tree is not large you could give one of those a try.