Note that there are some explanatory texts on larger screens.

plurals
  1. POASIHTTPRequest offline mode connection failure
    text
    copied!<p>I'm having an issue with <a href="http://allseeing-i.com/ASIHTTPRequest/" rel="nofollow">ASIHTTPRequest</a>, I try to develop an iphone app with an UIWebview which is usable when user launch it without network.</p> <p>This library is perfect but I get an error when I launch my app offline.</p> <pre><code>Error Domain=ASIHTTPRequestErrorDomain Code=1 UserInfo=0x17bdb0 "A connection failure occurred" </code></pre> <p>I can't find why this happen because I launched my app once (it means the cache is downloaded), and when I go throught SSH into my iPhone's App folder, I can see all cached data.</p> <p>Then why when I put my iPhone in airplane mode, I got this message ?</p> <p>Here is my code (pretty simple) to make the request :</p> <pre><code> NSURL *url = [NSURL URLWithString:@"http://mywebsite.com"]; [[self request] setDelegate:nil]; [[self request] cancel]; [self setRequest:[ASIWebPageRequest requestWithURL:url]]; [[self request] setShouldAttemptPersistentConnection:NO]; [[self request] setDelegate:self]; [[self request] setDidFailSelector:@selector(webPageFetchFailed:)]; [[self request] setDidFinishSelector:@selector(webPageFetchSucceeded:)]; [[self request] setUrlReplacementMode:ASIReplaceExternalResourcesWithData]; [request setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy]; [[self request] setDownloadCache:[ASIDownloadCache sharedCache]]; [[self request] setDownloadDestinationPath: [[ASIDownloadCache sharedCache] pathToStoreCachedResponseDataForRequest:[self request]]]; [[self request] startAsynchronous]; </code></pre> <p>I took the sample from the <a href="http://allseeing-i.com/ASIHTTPRequest/ASIWebPageRequest#" rel="nofollow">documentation</a>, this is why I don't understand where is the problem.</p> <p>Thanks for any help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload