0

I want to make a hybrid app , because some files(like images) have been cached in my app's bundle already. If I use a webView to load a web page in server. and this webPage is use these images , can the webView to visit the app's bundle file system?

ximmyxiao
  • 2,622
  • 3
  • 20
  • 35

1 Answers1

1

You could use some custom links to refer your bundle and change it on the fly from your app.

Let's say you use bundle://image.png then in your code you replace all "bundle://image.png" strings with someting like

[[NSBundle mainBundle] pathForResource:@"image" ofType:@"pnf" inDirectory:@"html_files"];

Anyway this approach creates a strong interdependence into the server and the app wich is not good I think. I will use a more conventional approach caching images with something like: https://github.com/path/FastImageCache

dminones
  • 2,236
  • 20
  • 21
  • thanks, the main purpose of the thought above is that i want to share those downloaded images between the server web page and my native app , Is the path's cach can support it ? – ximmyxiao Feb 10 '15 at 03:33
  • if the images are shared between web page and app you should try someting like this http://stackoverflow.com/questions/1162295/library-for-caching-web-pages-on-iphone – dminones Feb 10 '15 at 04:18