Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7557171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:03:43+00:00 2026-05-30T12:03:43+00:00

I am loading request like this [resultsWebView loadRequest:searchRequest]; Then I do this – (void)

  • 0

I am loading request like this [resultsWebView loadRequest:searchRequest]; Then I do this

- (void) webViewDidFinishLoad:(UIWebView *)webView {
    if ([resultsWebView canGoBack]) {
        [goBackButton setEnabled:YES];
    }
    else {
        [goBackButton setEnabled:NO];
    }
    if ([resultsWebView canGoForward]) {
        [goForwardButton setEnabled:YES];
    }
    else {
        [goForwardButton setEnabled:NO];
    }
}

canGoBack is always returning NO.
It was working earlier, but it has stopped working suddenly(I have not done any code changes). I don’t know how is this possible? Not getting any success to resolve this. There is a question on stackoverflow UIWebView canGoBack and canGoForward always return NO. But it is different as the question author was using loadData and he resolved the problem using loadRequest. But I am already using loadRequest. And again, it was working earlier, but it has stopped working suddenly(I have not done any code changes). Help me.

Cause of issue:

params = [NSString stringWithFormat:@"query=%@", searchTextField.text];
NSMutableURLRequest *searchRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.example.com/do/m/]];
[searchRequest setHTTPMethod:@"POST"];
[searchRequest setHTTPBody:[params dataUsingEncoding:NSUTF8StringEncoding]];

If I use the simple request like below, it works fine.

NSURLRequest *searchRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://www.example.com/do/m/?%@", params]] ];

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:03:44+00:00Added an answer on May 30, 2026 at 12:03 pm

    Finally, I found that, if the URL is same in the consecutive POST requests for the loadRequest method then canGoBack does not work. It was working for simple GET requests because URLs were different.
    To fix this, I sent the consecutive POST requests with two URLs, which are different from UIWebView perspective but actually same from the server perspective. I am setting the different URLs alternatively for consecutive POST requests, by adding a question-mark(?).

    https://www.example.com/do/m/

    https://www.example.com/do/m/?

    In this way the URLs become different for consecutive POST requests of UIWebView and canGoBack method works.

    Still I donot whether it is a bug in UIWebView or we can not use consecutive POST requests with UIWebView to get the canGoBack method works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My code looks like this: ... # class Site(Resource) def render_POST(self,request) otherclass.doAssync(request.args) print '1'
I am loading a .php file via an ExtJS AJAX call like this: menuItemApplication.header.on('click',
I'm loading (large) images dynamically to draw into a html5 canvas, something like this:
I'm loading a local web page and intercepting web clicks using: (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest
I am loading my script like this: var myTestString = /modules/admin; $.ajax({ type: GET,
I'm using JQuery UI tabs loading content via ajax like this: $('#tabsElem').tabs({ajaxOptions:{cache:false}, cache:true); Consider
I'm loading HTML from an AJAX request, and some img tags in it. I
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
After loading a PHP template (using jQuery's load function), this simple script won't make
After loading a reference to an assembly with something like: import clr clr.AddRferenceToFileAndPath(r'C:\foo.dll') How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.