In my Xamarin.iOS application, I have a byte array that I need to convert to a UIImage. I tried this:
var data = NSData.FromArray(myByteArray);
var uiimage = UIImage.LoadFromData(data);
But it won't work. It creates the UIImage, but when I set it to a UIImageView I don't see anything. I used the same byte array on the Android platform of my project and it works fine. So I assume the way I try to convert it to a UIImage is wrong.
myByteArraycontain?myByteArray, or at least the first/end bytes ofdata, since it's a JPEG, there should the be the corresponding StartOfFile/EndOfFile for .jpg. I don't use Xamarin, but could it be an issue of Big/LittleEndian?NSAllowsArbiraryLoadswas missing, thenmyByteArraywould be nil. So clearly, checking the value of it could have point it that the issue is on the download part.