I am having a huge problem on iOS 6.
I need to display a webpage when the app starts. I use the loadHTMLString for this. On everything before iOS 6 everything works as expected, but on iOS 6, it seems to take approx. 2 minutes to load anything that is not a text. All images and so forth take each 2 minutes to load, which makes my page load in just about 8 minutes. This works real fast on iOS 5.1 and below.
Here is an issue that I found on the site that explains my issue, but doesn't have an answer : https://devforums.apple.com/message/724010
I really need an answer on this.
When I make an empty app that does just this, everything works, if I put this inside an app that does some network before it starts, the issue pops up. so this is very difficult to isolate, but as far as I can get with UIWebView, I would think the issue is related to baseURL, but that is just a feeling.
I am not sure why this fixed my issue, but it did.
My View controller that called up the webview was in a static library because it was being re-used in other apps. By just moving the code out of the static library and into the application it self, the app started working much better and the web view works as well as one can expect now. There is no longer any difference between iOS 5 and iOS 6.
But by adding this code, it really made a huge difference :
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies]) {
[storage deleteCookie:cookie];
}
Like I said, I can't explain why moving the code into the app itself instead of having it as a library and the above code works, but I am sure it has something to do with how webview caches.