Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your line of code looks convoluted, but basically it is a very simple one.</p> <p>You should breakup this code from a one liner to multiple lines that are more readable. That will also allow you to log and check the URL you actually created, like so:</p> <p><code>NSLog(@"My url: %@", urlString);</code></p> <p>Update: I see you added the full url. Webview indeed fails to load that url (UIWebkit error 101).</p> <p>The part of the url that causes the problem is the '#' character and dictionary that follows in the params. You should url encode that part of the url.</p> <p>Try this:</p> <pre><code>NSString *address = @"http://m.forrent.com/search.php?"; NSString *params1 = @"address=92115&amp;beds=&amp;baths=&amp;price_to=0"; // URL encode the problematic part of the url. NSString *params2 = @"#{%22lat%22:%220%22,%22lon%22:%220%22,%22distance%22:%2225%22,%22seed%22:%221622727896%22,%22is_sort_default%22:%221%22,%22sort_by%22:%22%22,%22page%22:%221%22,%22startIndex%22:%220%22,%22address%22:%2292115%22,%22beds%22:%22%22,%22baths%22:%22%22,%22price_to%22:%220%22}"; params2 = [self escape:params2]; // Build the url and loadRequest NSString *urlString = [NSString stringWithFormat:@"%@%@%@",address,params1,params2]; [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]]; </code></pre> <p>The escaping method I used:</p> <pre><code>- (NSString *)escape:(NSString *)text { return (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, (__bridge CFStringRef)text, NULL, (CFStringRef)@"!*'();:@&amp;=+$,/?%#[]", kCFStringEncodingUTF8); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload