26

Aug

NSXMLParser doesn't fire - (void)parserDidEndDocument:(NSXMLParser *)parser

Today I ran into an issue where an NSXMLParser would not fire the parserDidEndDocument delegate method. I was parsing XML stored locally and it turned out to be an issue with a trailing newline at the end of the document.

To fix it, I made sure there was no newline at the end of the final closing XML tag. This seems lame of NSXMLParser or is there a convention I am just not aware of?

Nevertheless, I hope this helps someone.