Question

When I make a request for a webpage on the simulator I get the HTML, but when I make the request from the device (I tried on wifi and cellular networks). This happens consistently.

What would cause this?

EDIT: This is what is returning for me on the device, on the simulator I get the real page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title>Error</title>

<meta name=vs_defaultClientScript content="JavaScript">

<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">

<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">

<meta name=ProgId content=VisualStudio.HTML>

<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<link rel="stylesheet" id="style" runat="server" type="text/css" href="Data/style/mojo1.css" />

</head>

<body >

<br /><br />

<table ID="Table1">

<tr>

    <td width="100"></td>

    <td align="center">



    </td>
</tr>

<tr>

    <td width="100"></td>

    <td width="500">

        <p style="font-family:arial sans-serif;font-size:large">

        Sorry!

        </p>

        <p style="font-family:arial sans-serif;font-size:large">

        A server error has occurred.<br />

        The error has been logged and will be reviewed as soon as possible.

        It may have been a momentary problem; use the back button to try again or go back to the

        <a href="http://metrotransit.org/home.aspx">home</a> page.

        For assistance, call 612-373-3333 to speak with a transit representative.

        </p>

    </td>

</tr>

</table>

</body>

</html>

EDIT: I know it's not the User Agent. I made a custom configuration and the issue continues.

EDIT: Issue continues with NSURLRequest as well as NSURLSession.

Was it helpful?

Solution 2

My phone was in my native language which is not english. Changing hardware phone's language to english solved the problem.

OTHER TIPS

It is working for me!!!

My code is as follow:

-(IBAction)web_pressed:(id)sender
{
    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"http://metrotransit.org/"]];
}

Let me know if you have any problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top