ios - How to Convert Nsdata to Unsigned or signed Byte array -
this question has answer here:
- how convert nsdata byte array in iphone? 5 answers
in app have upload byte array(audio ) server .
but getting nsdata .how convert nsdata byte array post audio file server
can 1 me?
your can use bytes method of nsdata;
nsuinteger len = [yourdata length]; byte *bytedata = (byte*)malloc(len); memcpy(bytedata, [yourdata bytes], len); if byte null terminated can use
nsstring *content = [nsstring stringwithutf8string:[yourdata bytes]]; and if not
nsstring *content = [[nsstring alloc] initwithbytes:[yourdata bytes] length:[yourdata length] encoding: nsutf8stringencoding];
Comments
Post a Comment