I am loading some Wikipedia pages from a webarchive (created in desktop Safari) in a UIWebView. This allows the pages to be available offline.
However, for some reason the images aren't loading when offline. It appears that they are being loaded from the website.
Everything worked fine in the past and I've noticed that the problem only effects new webarchives created after Wikipedia updated their mobile website format.
It's strange because the images load when offline if I open the webarchive on my computer, but not in iOS.
Any idea what's going on here?
I'm using the following code to load the webarchive:
NSString *fileName=[[NSString alloc] initWithFormat:@"%@", appDelegate.urlName];
NSString *htmlPath=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fileName];
NSURL *url=[NSURL URLWithString:[htmlPath lastPathComponent] relativeToURL:[NSURL fileURLWithPath:[htmlPath stringByDeletingLastPathComponent] isDirectory:YES]];
[self.myWebView loadRequest:[NSURLRequest requestWithURL:url]];
Update: I also found out that loading a webarchive in mobile safari made from the mobile wikipedia site will cause a crash in iOS 7.
Here is a link to a new webarchive that is causing problems and one from the old version of Wikipedia that works fine. I've changed the file extension to "plist" so they can easily be edited. Change back to "webarchive" to test.
(NEW) https://dl.dropboxusercontent.com/u/20616325/Badger%20%28NEW%29.plist
(OLD) https://dl.dropboxusercontent.com/u/20616325/Badger%20%28OLD%29.plist