【问题标题】:UIWebView not opening the secured urlUIWebView 没有打开安全的 url
【发布时间】:2012-01-14 10:03:51
【问题描述】:

在一个 iPhone 应用程序中,我创建了一个 UIWebView,它成功加载了 http://www.google.com。 但是相同的 web 视图没有加载https://xxxseal.xxxxbank.com/mpi/Ssl.jsp?transactionId=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX(支付网关 URL),但是在 Safari 和其他浏览器中成功打开了相同的 URL。任何人都可以解释并帮助我吗?

【问题讨论】:

    标签: ios iphone objective-c uiwebview payment-gateway


    【解决方案1】:

    您需要使用 NSString 的– stringByAddingPercentEscapesUsingEncoding: 方法正确格式化字符串,然后再将其转换为 NSURL。

    【讨论】:

      【解决方案2】:

      试试这个:

      NSString *postString;
      postString = [NSString stringWithFormat:@"https://xxxseal.xxxxbank.com/mpi/Ssl.jsp?transactionId=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]; 
      postString = [postString stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)NSUTF8StringEncoding];
      [WebViewObj loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:postString]]];
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-01-26
        • 1970-01-01
        • 2011-02-12
        • 2014-11-20
        • 1970-01-01
        • 1970-01-01
        • 2011-02-10
        • 1970-01-01
        相关资源
        最近更新 更多