views:

135

answers:

1

I am building an iphone app that will require downloading an image from an ASP.NET web application (either as part of an XML document that is formatted according to the property list schema or by itself) into an (NSData *) object.

What encoder should I use on the server side to generate compatible XML for the iphone? Is it as simple as just Base64? What about BigEndian vs. LittleEndian issues?

Thanks, -MrB

+1  A: 

The endian-ness of XML is defined by the text encoding of the document. So, as long as you use a standard encoding (UTF-8, say, or UTF-8) on both sides, it really should be as simple as using Convert.ToBase64String on your image's binary data.

jlew
Follow-up question: will a Base64 encoded string from .NET decode correctly into an NSData obect that can be loaded into a UIImage when the data gets received by the iphone from the server?
Sorry, don't really know anything about the iPhone side of this, I was just addressing the endian issue. I imagine you need to use the iPhone's XML parser to do the base64-to-bytes decode and then feed the bytes to NSData somehow.
jlew