I searched high and low for the past week, none of the similar questions on SO has solved my problem.
I'm trying to upload a UIImage to a .NET wcf (wsdl?). It needs to be in the form of a byte array.
I tried
NSData *data = [[NSData alloc]initWithData:UIImageJPEGRepresentation(Image, 1)];
NSUInteger len = [data length];
Byte *byteData = (Byte*)malloc(len);
memcpy(byteData, [data bytes], len);
and byteData returns
ˇÿˇ‡
That doesn't look like a byte array I'm sure. What does a byte array suppose to look like? I also tried called NSData description, and various others with no success.
I also tried
[self.imageFile base64EncodedStringWithOptions:NSDataBase64EncodingEndLineFeed];
and get back
/9j/4AAQSkZJRgABAQEAJAAkAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAAkA
Is that what a byte array suppose to look like? I would guess a byte array is suppose to look like the following.
[244, 22, 244, 4, 32, etc.....]
The byte array needs to be embedded in an XML. Any help is appreciated. Thanks!