The LogYourRun app uses both UIWebView and NSURLRequest to communicate with the LogYourRun database. To let users upload and access their data. These requests often contain fields that the user enter such as running notes, distance, time etc. I had the WebKitErrorDomain 101 error come up on occasions when users tried to send requests that contained spaces that were not properly encoded. I was not able to find any documentation on this error so it took a while to figure out what was going on.
Once I identified that the issue was that some users had a space in their username it is a very easy fix. Just use the stringByAddingPercentEscapesUsingEncoding function to have the string properly encoded:
[username stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
So if you come along a WebKitErrorDomain 101 error – take a look at the URL you are trying to submit and see if all the parts of it are properly encoded.

1. Comment by Nam Young jun
4/Mar/2011 at 7:34 am
I did not know speak English translator has written.
The following information is the same error. (WebKitErrorDomain error 101)
Is this a keyboard problem, or is the encoding problem ….
I’m not sure where I got the error ….
Sources are listed below the search box ..
- (Void) searchBarSearchButtonClicked: (UISearchBar *) activeSearchBar {
NSString * query = [searchBar.text
stringByReplacingOccurrencesOfString: @ "" withString: @ "+"];
NSURL * url = [NSURL URLWithString:
[NSString stringWithFormat: @ "http://search.naver.com/search.naver ?=%@", query]];
NSURLRequest * requestObj = [NSURLRequest requestWithURL: url];
[Home loadRequest: requestObj];
}
- (Void) loadView {
[Super loadView];
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
searchBar = [[UISearchBar alloc] initWithFrame:
CGRectMake (0.0, 0.0, bounds.size.width, 48.0)];
searchBar.delegate = self;
[Self.view addSubview: searchBar];
}
I do not know where the error occurred?
2. Comment by Nam Young-jun
4/Mar/2011 at 7:51 am
http://www.google.com/search?q =% @
If that is true on.
Please Note.
3. Comment by Tim
4/Mar/2011 at 9:13 am
You have spaces in your query string and you should be URLencoding your query:
[query stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];