While testing my application, i connected to a wifi network which needed an authentication to access the internet.
I would have like [NSString stringWithContentOfUrl:encoding:error:] to fail or return the content of this authentication page even if it is not the page I asked. But it keeps on trying to download, and never returns.
Do you have any solution to detect this kind of issue ?
While testing my application, i connected to a wifi network which needed an authentication
Share
I would recommend using
NSURLConnection. When a redirect happens it will call the delegate method as mentioned here. Also withNSURLConnectionyou will have greater control in the future when you add additional features and content. Or should the router not do a redirect and just force you to a page, you will be able to use theNSURLConnectionto download the content and parse it to determine if it is indeed the page you were looking for.