views:

39

answers:

1

Hello all, I built iphone app that getting inforamtion from server(this is server that i built also). the data from the server is type XML and i use the xml parser to parse the message. what i want is to add image to be send from the server and i am asking if i cann add binary data such image to the xml message.for example 10 tags will be text and 1 tag will be binary(the image). so when the xml parser will get to the binary tag it will insert the data to NSDATA object and the rest of the tags will insert to NSString.

does the xml parser of coca can handle this situation

if not what you think will be the easiest way to do this with one connection to the server so the data from the server will be send once.

+1  A: 

To transfer binary data wrapped in XML, encode it using e.g. Base64, which turns your binary data into characters that won't mess up your XML.

mwittrock
does i need to convert it back to binary or i can put the Base64 to the initWithdata for the image?
Amir
You'll need to decode it in order to get at the binary data.
mwittrock
can you tell me how to decode it ? i saw some examples in the net but its look to complicated
Amir
I'm sorry; my knowledge of Objective-C and its libraries is zero :-)
mwittrock