RunLoop
RunLoop

Reputation: 20376

UIWebView Woes - Error 101

UIWebView won't load (Error 101) the following URL: http://afrikaans.news24.com/Sci-tech/Nuus/Rwanda-gaan-Suid-Afrikaanse-wild-invoer-20111116

I have tried percentescapes to no avail. Please help!

Upvotes: 1

Views: 1934

Answers (2)

Damo
Damo

Reputation: 12900

Try something like

NSString *unencodedURLString = @"http://afrikaans.news24.com/Sci-tech/Nuus/Rwanda-gaan-Suid-Afrikaanse-wild-invoer-20111116";
NSString *encodedURLString = [unencodedURLString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];

//Create a URL object.
NSURL *weburl = [NSURL encodedURLString];
//URL Requst Object 
NSURLRequest *requestObj = [NSURLRequest requestWithURL:weburl];

//load the URL into the web view.
[aWebView loadRequest:requestObj];

Upvotes: 1

Raptor
Raptor

Reputation: 54258

Try this:

//Set the URL to go to for your UIWebView
NSString *webAddressString = @"http://afrikaans.news24.com/Sci-tech/Nuus/Rwanda-gaan-Suid-Afrikaanse-wild-invoer-20111116";
NSLog(@"show webAddressString: %@", webAddressString);

//Create a URL object.
NSURL *weburl = [NSURL URLWithString:webAddressString];
[webAddressString release];
//URL Requst Object 
NSURLRequest *requestObj = [NSURLRequest requestWithURL:weburl];

//load the URL into the web view.
[aWebView loadRequest:requestObj];

Error 101 is The operation couldn’t be completed., which is led by either domain not found , network problem or even object allocation ( as searched from Google ) .

Upvotes: 1

Related Questions