reza_khalafi reza_khalafi - 6 months ago 19
iOS Question

How to load png image from document in UIWebView in iOS 8 Objective c

I have some png image in my document and i wanna to load these images in UIWebView like

<img src='/Users/rezakhalafi/Library/Developer/CoreSimulator/Devices/1784E9F2-4DCA-4D72-A7B0-1D74AFAFDFBA/data/Containers/Data/Application/54A0319C-A33D-4993-9CA3-20F73B8CD85F/Documents/CACHE/cache332377/9cache.png'>


But it does not work.

I am using Objective C.

Please help me.

Answer

I found it.
just add file:/ at the begin of address string.

<img src='file:/Users/rezakhalafi/Library/Developer/CoreSimulator/Devices/1784E9F2-4DCA-4D72-A7B0-1D74AFAFDFBA/data/Containers/Data/Application/54A0319C-A33D-4993-9CA3-20F73B8CD85F/Documents/CACHE/cache332377/9cache.png'>