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

  • Home
  • SEARCH
  • 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 8931031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:01:10+00:00 2026-06-15T09:01:10+00:00

So the problem I am having is that I’m using RestKit to to authenticate

  • 0

So the problem I am having is that I’m using RestKit to to authenticate a self signed certificate and deal with user login simultaneously but after the webView opens then that first page is not being added to the backForward list (as far as i can tell). i.e. after i click on a link on that page I cannot go back to the previous page. If I click on another link (3 pages in) i can go back to the second page but still not the first.. Is there a way to manually add the URL to the backForward list when I open the UI Webview? Or any suggestions for other work-arounds?

- (id)initWithURL:(NSURL*)pageURL {

    _retainedURL = pageURL;
    [_retainedURL retain];

    RKClient *client;
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    client = [RKClient clientWithBaseURL: pageURL];
    client.username=[userDefaults objectForKey:@"UserName"];
    client.password=[userDefaults objectForKey:@"Password"];
    client.authenticationType=RKRequestAuthenticationTypeHTTPBasic;
    client.disableCertificateValidation= TRUE;
    //The below "delegate:self seems to be what is preventing the URL from passing into the forwardBack list (works if it is delegate self but then RestKit breaks
    RKRequest *request=[RKRequest requestWithURL:pageURL delegate:self];
    [client configureRequest:request];
    request.authenticationType = RKRequestAuthenticationTypeHTTPBasic;
    request.disableCertificateValidation = TRUE;
    self.authenticatedRequest = request;
    NSLog(@"%@",[request URLRequest]);
    [request sendAsynchronously];

    if(self = [super init]) {
        self.URL = pageURL;
        self.availableActions = SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsMailLink | SVWebViewControllerAvailableActionsCopyLink;
    }
    return self;
}
  • 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-06-15T09:01:11+00:00Added an answer on June 15, 2026 at 9:01 am

    I ended up fixing this error by creating an NSMutableArray array to keep track of the browser history and adding code to handle various things such as the forward and back buttons display. I’m using 2 ints (urlListIndex and urlIndexMax) as well as a BOOL (backFix) for navigation control

            - (id)initWithURL:(NSURL*)pageURL {
    
            _retainedURL = pageURL;
            [_retainedURL retain];
    
            RKClient *client;
            NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
            client = [RKClient clientWithBaseURL: pageURL];
            client.username=[userDefaults objectForKey:@"UserName"];
            client.password=[userDefaults objectForKey:@"Password"];
            client.authenticationType=RKRequestAuthenticationTypeHTTPBasic;
            client.disableCertificateValidation= TRUE;
            RKRequest *request=[RKRequest requestWithURL:pageURL];
            [client configureRequest:request];
            request.delegate = self;
            request.authenticationType = RKRequestAuthenticationTypeHTTPBasic;
            request.disableCertificateValidation = TRUE;
            self.authenticatedRequest = request;
            [request sendAsynchronously];
    
            //Instantiate urlList (for web history) and urlListIndex 
            urlList = [[NSMutableArray alloc] init];
            urlListIndex = 0;
    
            if(self = [super init]) {
                self.URL = pageURL;
                self.availableActions = SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsMailLink | SVWebViewControllerAvailableActionsCopyLink;
            }
              return self;
        }
    
        - (void)updateToolbarItems {
    
            //check if you are further than the first page. If so, enable the back button
            if (urlListIndex > 0)
            {
            self.backBarButtonItem.enabled = YES;
            }
            else
            {
            self.backBarButtonItem.enabled = NO;
            }
    
            //Check if there are more total urls in the list than the one you are on. If so, enable the forward button
            if (urlListIndex < maxListIndex)
            {
            self.forwardBarButtonItem.enabled = YES;
            }
            else
            {
            self.forwardBarButtonItem.enabled = NO;  
            }
        //Took out the rest for space 
    
    - (void)webViewDidFinishLoad:(UIWebView *)webView {
        [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
        self.navigationItem.title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];
    
        NSURL *urlstring = self.mainWebView.request.URL;
    
        //Check to see if the current url is in the list. If not, add it to the list.
        if ([urlList containsObject:urlstring])
        {}
        else
        {
            //The first url you click doesnt show up normally so an exception is used here with _retainedURL
            if (_retainedURL != nil) 
            {
                [urlList addObject:_retainedURL];
                _retainedURL = nil;
            }
            else
                { if (backFix == NO)
                {
                    urlListIndex++;
                    [urlList addObject:urlstring];
                }
                }
        }
    
        //Keeps track of the max number of URLs in the list
        if (urlListIndex > maxListIndex)
        {
            maxListIndex = urlListIndex;
        }
    
        [self updateToolbarItems];
        backFix = NO;
    }
    
    - (void)goBackClicked:(UIBarButtonItem *)sender {
        backFix = YES;
        urlListIndex--;
        _request = [NSURLRequest requestWithURL:[urlList objectAtIndex:urlListIndex]];
       [mainWebView loadRequest:_request];
    }
    
    //Handles the forward button by incrementing the urlListIndex and then loading the url for that index.
    - (void)goForwardClicked:(UIBarButtonItem *)sender {
        urlListIndex++;
        _request = [NSURLRequest requestWithURL:[urlList objectAtIndex:urlListIndex]];
        [mainWebView loadRequest:_request];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem im having is that I have a table that when a user
I am having problem that when i am trying to submit the form by
Hi The problem am having is that I have multiple TreeView control and each
HI Guys, Here I am having problem that How can I post an image
The problem I'm having is that the first URL works and the second one
The problem I'm having is that the first URL works and the second one
The problem I'm having is that I want to use STL's sort with a
the Problem I am having is that the PostExecute is not firing. I see
the problem I'm having is that cyrillic text looks bold ( Example ) even
The problem i'm having is that i've created a web service, and a windows

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.