I have a website which can be used offline too. I have created an app which use UIWebView
and I said that my UIWebView
should cache this site with the following code
[self setRequestObj:[NSURLRequest requestWithURL:loadUrl cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]];
If I started my app the first time with internet connection my console
logged
2016-08-24 15:37:01.713 BrowserApp[1991:345138] applicationDidBecomeActive!
2016-08-24 15:37:01.955 BrowserApp[1991:345138] NSURLRequestUseProtocolCachePolicy
2016-08-24 15:37:22.003 BrowserApp[1991:345138] applicationDidEnterBackground!
2016-08-24 15:37:22.559 BrowserApp[1991:345138] applicationWillEnterForeground!
2016-08-24 15:37:23.075 BrowserApp[1991:345138] applicationDidBecomeActive!
2016-08-24 15:37:37.069 BrowserApp[1991:345138] applicationDidEnterBackground!
2016-08-24 15:37:37.073 BrowserApp[1991:345138] applicationWillTerminate!
I see that every method is called in the file AppDelegate.m
. I disconnect my phone from the internet, launch my app again (wasn't in the background like my console
told) and nothing happens. I only get a white website.
Why the website
wouldn't be displayed on my screen although I set to cache
it?