reza_khalafi reza_khalafi - 1 year ago 110
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 Source

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'>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download