in my app i have to upload byte array(Audio ) to server .
BUt now We are getting Nsdata .How to convert this Nsdata to Byte array to post the Audio file to server
Can any one help me?
in my app i have to upload byte array(Audio ) to server .
BUt now We are getting Nsdata .How to convert this Nsdata to Byte array to post the Audio file to server
Can any one help me?
your can use bytes
method of NSData;
NSUInteger len = [yourData length];
Byte *byteData = (Byte*)malloc(len);
memcpy(byteData, [yourData bytes], len);
If your byte is null terminated you can use
NSString *content = [NSString stringWithUTF8String:[yourData bytes]];
and if not
NSString *content = [[NSString alloc] initWithBytes:[yourData bytes]
length:[yourData length] encoding: NSUTF8StringEncoding];