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 7552265
In Process

The Archive Base Latest Questions

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

Simple question that would be fantastic if somebody could answer. I have a simple

  • 0

Simple question that would be fantastic if somebody could answer.

I have a simple UIWebView used to log in to a certain service. However, when I reload the application, it stays logged in. What I need to be able to do is create the UIWebView like new each and every time the application starts. I’m not sure if there is an option somewhere in the interface builder, or perhaps a method of some kind I can place in the method that gets called when the app terminates, so that it releases the WebView or something.

  • 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-30T10:43:02+00:00Added an answer on May 30, 2026 at 10:43 am

    What you need to do is not save the cache of the UIwebView. You can do this with a simple code like:

    NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
    [NSURLCache setSharedURLCache:sharedCache];
    

    Place the code in the UIwebview code.

    Or in ApplicationDidFinishLoad (or something like that, haha) you can remove the cache with:

    [[NSURLCache sharedURLCache] removeAllCachedResponses];
    

    Edit:

    You’ve asked something in the comments. You can do something like the code below:

        NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.google.com"]];
    
            UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0.f, 0.f, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 20.f)];
            [webView setAutoresizingMask:(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth)];
    
    //No Cache\\
    
          NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
            [NSURLCache setSharedURLCache:sharedCache];
    
    //No Cache\\
    
            webView.delegate = self;
            [webView loadRequest:request];
            [self.view addSubview:webView];
    

    Ok,

    Remove a specific request

    [[NSURLCache sharedURLCache] removeCachedResponseForRequest:NSURLRequest];
    

    Or delete al cookies from the UIWebView

    for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
    
        if([[cookie domain] isEqualToString:someNSStringUrlDomain]) {
    
            [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
        }
    }
    

    Good luck,
    Nathan

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

Sidebar

Related Questions

I have a relatively simple question that I cannot seem to find the answer
I have a simple question, but I'm about 80% sure that the answer to
Pretty simple question, I have a webpage that is used exclusively on iPads. I've
I have a simple question that I am posing mostly for my curiousity. What
I am learning LINQ and have a very simple question that I think will
Here's a very simple question. I have an SP that inserts a row into
This is a (hopefully) really simple question - I have been told recently that
I have a quick question that I'm sure some of you would have an
I have a simple question that I am having trouble trying to find an
I have a simple question. I know that shell scripts are slow/ineffective when it

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.