Decode base64 array of bytes to txt file - iPhone
I'm geting an array of bytes (it's a txt file) from a server that I need to save at my app's documents folder. I,ve tried many solutions I found and I managed to save the file, but the encoding appears to be wrong, when I try to view the contents of the txt file saved the first line says:
<.base64Binary xmlns="http://schemas.microsoft.com/开发者_C百科2003/10/Serialization/">
...then about 50 lines of random characters until the document ends with:
<./base64Binary>
I've tried decoding the NSData to nsstring using some examples i've found, but none could solve this problem
thanks
I've tried this solutions:
http://www.cocoadev.com/index.pl?BaseSixtyFour
http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html
Finally solved it!! Using part of the code in
http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html
into my classes and parsing the xml before encoding.
精彩评论