views:

30

answers:

1

I've a general question, I've been using NSXMLParser to parse a pretty large XML file containing byte array's of images sent from a web service to the iPhone. I tried switching to AQXMLParser to bring down the memory footprint however now I'm unable to decode my byte arrays in the same way.

When parsing the URL I use foundCharacters to read in the string of the byte[] and pass this to some standard code I found on the net which gives me back the NSData I then use to create my image. The error I'm getting with AQXMLParser is "Application transferred too few scanlines". My suspicion was that because AQXMLParser chunks up the data my parsing class isn't getting enough of the image data in one chunk to enable it to parse the whole image?

Off the top of your head does anyone know why this would work ok with NSXMLParser but not with AQXMLParser? Or can anyone suggest a better way to send images from my web service, pretty new to all of this! The images need to be sent to the device and are then stored locally for future access, hosting them on the web and accessing them via a url is not an option.

Any thoughts that anyone has would be helpful, I can post some code if need be.

Thanks :)

+1  A: 

Not directly answering your question, but XML is pretty terrible for binary data. Have you considered hosting it as individual files, or in a zip? ZipArchive is vaguely reasonable.

tc.