I am working on an iPad app which has an embedded HTTP server listening on a high port, and I am loading pages from this HTTP server using a UIWebView
.
For the functionality of the app, it is important that this works when no network connection is available.
The UIWebView
is loading URLs of the form http://localhost:port/path
When I disable Wi-Fi on my iPad and run the application, the UIWebView
’s delegate gets a webView:didFailLoadWithError:
message with the following NSError object:
Error Domain=NSURLErrorDomain Code=-1009 UserInfo=0x1b4a50 "no Internet connection"
Clearly the SDK is being clever and detecting that it has no Internet connection, but it should be possible to access 127.0.0.1/localhost/::1 without an Internet connection. I will report the bug to Apple but am asking here for advice about possible workarounds for this SDK bug in the meantime.
Please note: changing the architecture of the application is not in scope for this question.