Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 6, 2011, 10:39 AM   #1
sivaprakash
macrumors member
 
Join Date: Mar 2011
Location: Chennai, India
WebView Error

Hi

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)

https://xxxxx.xxxxxxxxxxxx.com/Vendo...password=*****


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.

Thanks
Siva
sivaprakash is offline   0 Reply With Quote
Old Apr 6, 2011, 03:20 PM   #2
Sydde
macrumors 68000
 
Sydde's Avatar
 
Join Date: Aug 2009
Try %escape-coding your string (there is a method in NSString for doing this).
__________________
You got to be a spirit. You can't be no ghost.
Sydde is offline   0 Reply With Quote
Old Apr 6, 2011, 05:01 PM   #3
jiminaus
macrumors 65816
 
Join Date: Dec 2010
Location: Sydney
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.
jiminaus is offline   0 Reply With Quote
Old Apr 6, 2011, 05:40 PM   #4
PatrickCocoa
macrumors 6502a
 
Join Date: Dec 2008
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?
__________________
iMac 21.5", 3.06GHz, 4 GB, 2 TB HD.
iPod Touch 3G.
PatrickCocoa is offline   0 Reply With Quote
Old Apr 6, 2011, 09:23 PM   #5
sivaprakash
Thread Starter
macrumors member
 
Join Date: Mar 2011
Location: Chennai, India
@ Patrick - Answer for all your questions is YES. But it doesnt work in WebView only.
sivaprakash is offline   0 Reply With Quote
Old Apr 6, 2011, 09:38 PM   #6
PatrickCocoa
macrumors 6502a
 
Join Date: Dec 2008
hmmm . . .

Quote:
Originally Posted by sivaprakash View Post
@ Patrick - Answer for all your questions is YES. But it doesnt work in WebView only.
As previously suggested, maybe there's some character in the URL that WebView doesn't like. The most unusual URL I ever load is:
@"http://www.highschoolsports.net/defaultcal.cfm?ct=s&schoolid=KS6621212106&spt=4&lvl=-1&divison=-1&timeoffset=300"

which works fine.

Maybe try simpler versions of your URL, starting with something basic and working up, adding complexity until it breaks. Start with:
@"https://xxxxx.xxxxxxxxxxxx.com/"

and see if that works.
__________________
iMac 21.5", 3.06GHz, 4 GB, 2 TB HD.
iPod Touch 3G.
PatrickCocoa is offline   0 Reply With Quote
Old Apr 6, 2011, 09:46 PM   #7
sivaprakash
Thread Starter
macrumors member
 
Join Date: Mar 2011
Location: Chennai, India
The simpler version of URLs are working well. Do I need to add any escape characters?
sivaprakash is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Webview didFinishLoadForFrame DennisBlah Mac Programming 6 Mar 14, 2014 12:00 PM
YouTube and Webview issue DavidBlack Mac Programming 1 Feb 4, 2014 12:50 PM
WebView does not respond to scrollToPoint: Blakeasd Mac Programming 0 Dec 3, 2013 07:35 PM
Content Inset with WebView Blakeasd Mac Programming 2 Nov 30, 2013 10:27 PM
WebView in Cocoa (Objective-C) tr!pf!3 Mac Programming 0 Aug 28, 2012 10:48 AM

Forum Jump

All times are GMT -5. The time now is 01:37 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC