0

シミュレーターで Web ページをリクエストすると HTML が取得されますが、デバイスからリクエストを行うと (Wi-Fi とセルラー ネットワークで試しました)。これは一貫して発生します。

これは何が原因でしょうか?

編集:これは、デバイスで私に返されるものです。シミュレーターでは、実際のページを取得します:

<!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>

編集: ユーザー エージェントではないことはわかっています。カスタム構成を作成しましたが、問題が続きます。

編集: NSURLRequest と NSURLSession で問題が続きます。

4

2 に答える 2

0

私の電話は英語ではない私の母国語でした。ハードウェア電話の言語を英語に変更すると、問題が解決しました。

于 2013-10-15T20:42:48.173 に答える
0

それは私のために働いています!!!

私のコードは次のとおりです。

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

何か問題がありましたらお知らせください。

于 2013-10-15T06:34:38.590 に答える