objective c - How to display image correctly from link ? ios -
i using code display images on ios app :
nsdata *receiveddata = [nsdata datawithcontentsofurl:[nsurl urlwithstring:url]]; self.image=nil; uiimage *img = [[uiimage alloc] initwithdata:receiveddata ]; self.image = img;
this code work perfect many images , can't display image : https://docs.google.com/uc?authuser=0&id=0bw8vnowkrlfgumc3ahbkczkwbjq&export=download
also android app display correctly !
what's problem ?
edit : mention can't open image on mac preview , shows message : may damaged or use file format preview doesn’t recognize. can open chrome.
your image isn't valid png file. it's webp image. it's supported google chrome, os x or ios doesn't have native support format, that's why code doesn't work.
Comments
Post a Comment