I'd like to be able to parse a local XML file, rather than one hosted out on the web somewhere. I followed the example found here: Parsing XML Files - iPhone SDK Articles but was unsuccessful in modifying the project to read a local file. Any help would be greatly appreciated.
Once I get that working, I'd like to be able to import XML files into an app. Preferably by emailing the file and opening the attachment on the iPhone. Is this doable, and if so, are there tutorials and/or documentation that someone can point out?
I'd like to be able to parse a local XML file, rather than one hosted out on the web somewhere. I followed the example found here: Parsing XML Files - iPhone SDK Articles but was unsuccessful in modifying the project to read a local file. Any help would be greatly appreciated.
Once I get that working, I'd like to be able to import XML files into an app. Preferably by emailing the file and opening the attachment on the iPhone. Is this doable, and if so, are there tutorials and/or documentation that someone can point out?
I'd like to be able to parse a local XML file, rather than one hosted out on the web somewhere.
You might want to take a look at the iPhone in Action book and source code. They have an example in Chapter 20 that reads an XML file stored on the device.
Thank you. Fixing dataWithContentsOfFile got rid of that warning.
Quote:
Originally Posted by smithdale87
and it should be NSXMLParser
Where should I change this?
I tried changing each of the three instances of "xmlparser" to "NSXMLParser" in the first bad line, individually and in combination, and the error did not change.
If I change "xmlParser" to "NSXMLParser" in the second bad line, the error changes to the warning:
Code:
.../iPhone Apps/XML/Classes/XMLAppDelegate.m:28: warning: 'NSXMLParser' may not respond to '+setDelegate:'
He's talking about your class XMLParser. Is this one you declared? If not then it needs to be NSXMLParser when you declare variables of this class
NSXMLParser is a class, so changing your variable names to it is a bad thing No offense intended, but you might want to consider taking a step back and studying C and objective-c, and the differences between variables,instances, types, and classes. I think it will make your life easier.
Thanks for the info. I was assuming the sample project I was starting with was constructed sensibly. Perhaps that's assuming too much?
Quote:
Originally Posted by yezaev
you might want to consider taking a step back and studying C and objective-c, and the differences between variables,instances, types, and classes. I think it will make your life easier.
That's sound advice, and I'm doing that too, but at the same time, I'm attempting to deconstruct and modify sample projects. This is how I taught myself several other technical subjects and I'm hoping the method will serve me here too.