WebView Error

Discussion in 'Mac Programming' started by sivaprakash, Apr 6, 2011.

  1. macrumors member


    I am trying to load an URL in WebView and I am getting an error "Browser not Supported. Please try a more recent version, or a different browser."

    URL that I am trying to load (model)


    Code that I am using to load is

    NSString *urlText ;

    urlText = @"https://xxxxx.xxxxxxxxxxxx.com/Vendor?xxxxx=none&xxxxxxx=none&xxx=3456&xxxx=4322&username=yyyy&password=*****";

    [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];

    Can someone help me what is wrong in my code ? Or do I need to Upgrade. I may machine Safari is the default browser. But if use the browser to load this URL works fine I am facing issue only with the WebView at the same time other sites like www.google.com and others are working well.

  2. macrumors 68000


    Try %escape-coding your string (there is a method in NSString for doing this).
  3. macrumors 65816


    This doesn't sound like an error from WebView itself, but an "error" page that's being served from the web application you're trying to access. Try spoofing the user agent.

    BTW WebView always uses Safari's WebKit engine regardless of your default browser. That is if you make Firefox your default browser, your program wouldn't start embedding Firefox into your window.
  4. macrumors 6502a

    Debug Time!

    Can you access that URL from Safari?
    Can you access that URL from Firefox?
    Can you access that URL from IE 6?
    Can you access other URLs using your code?
  5. macrumors member

    @ Patrick - Answer for all your questions is YES. But it doesnt work in WebView only.
  6. macrumors 6502a

    hmmm . . .

    As previously suggested, maybe there's some character in the URL that WebView doesn't like. The most unusual URL I ever load is:

    which works fine.

    Maybe try simpler versions of your URL, starting with something basic and working up, adding complexity until it breaks. Start with:

    and see if that works.
  7. macrumors member

    The simpler version of URLs are working well. Do I need to add any escape characters?

Share This Page