ios - How to Convert Nsdata to Unsigned or signed Byte array -


this question has answer here:

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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -