0

I am using xamarin.ios I have already uploaded a selected image to server. And I want to get it again. I am getting NSUrl as http://172.16.10.49/thunder_ex/backend/web/uploads/AppUserProfilePic/Profile_140.jpg . I want to use this NSUrl and show the image in UIImage. I tried

NSData data;    

data = NSData.FromUrl(url);

profileImage.Image = UIImage.LoadFromData(data);

But I am getting data as null.

Himanth
  • 2,381
  • 3
  • 28
  • 41
Prajakta Shinde
  • 101
  • 1
  • 12

1 Answers1

0

Your code should work, in fact it's very similar to the one I posted there.

If you get null it generally comes from either:

  • the URL, i.e. an invalid URL (that iOS does not like) will return `null; or

  • the downloaded data is not in a format that iOS supports.

The URL you provided does not seems to connect or load (from Chrome) for me. That could also be the reason (as the API does not have any other way to return an error condition).

Community
  • 1
  • 1
poupou
  • 43,413
  • 6
  • 77
  • 174