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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:46:30+00:00 2026-05-21T09:46:30+00:00

I have a view that includes a UIWebView as well as an iAD AdBannerView.

  • 0

I have a view that includes a UIWebView as well as an iAD AdBannerView.

To optimize the experience and reduce bandwidth contention – I suspend the UIWebView’s network activity when the iAd “detail view” is being loaded and resume it when the user returns from the ad. Currently, I simply do the following:

-(BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave
{

    if (self.webView.loading) {
        [self.webView stopLoading];
        self.loadingWasInterrupted = TRUE;
    }
    return YES;
}

-(void)bannerViewActionDidFinish:(ADBannerView *)banner
{
    if (self.loadingWasInterrupted) {
        //Should use loadRequest: instead?
        [self.webView reload];
    }
}

I’m trying to understand if it there is any difference between calling reload vs. loadRequest: a second time, and if so, which is more efficient.

I’m guessing reload simply just saves you having to hold onto the request object and really does the same thing but I’d like to know for sure. The docs and header don’t offer any clue.

I understand I could pick apart the network activity to understand what’s happening but would appreciate any insight from someone who has looked at this before or who generally understands if reload behavior differs from loadRequest at all. Thank you.

  • 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-21T09:46:31+00:00Added an answer on May 21, 2026 at 9:46 am

    Okay, a fairly complicated solution but never the less one that I think might work for you:

    Define a custom protocol handler for http:

    http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/10000165i

    Using NSURLProtocol as the subclass. The handler will start a NSURLConnection, and return the data as it comes in to the client (in this case this will be the UIWebView that initiated the connection). Have it add itself as an observer to NSNotificationCenter for a “Pause” notification.

    When you would like to display an iAd, you can send your pause notification, this will cancel the NSURLConnection (but not the NSURLProtocol, which will remain open and loading, and thus your webview will continue to appear as if it were loading).

    Then when the add is finished you can send a “resume” notification (much the same), except in this case any active NSURLProtocol handlers receiving the notification will create new NSURLConnections, using the Range: header to resume where they left off:

    iphone sdk: pausing NSURLConnection?

    Some caveats:

    Only will work when browsing websites that support the resume header (otherwise you might have to start the connection anew, and just ignore data prior to the latest byte received).

    Your NSURLRequests should be formed so that they don’t have a timeout. (if you want a timeout then it should be in the NSURLProtocol handlers NSURLConnections).

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

Sidebar

Related Questions

I have a detail view that includes three UIButtons, each of which pushes a
I have a detail view that includes three UIButtons, each of which pushes a
I have a view that includes a table. var newsIndexView = Backbone.View.extend({ ... });
This might be simple, but..... I have a view that includes a text area:
I have a custom view that extends ViewGroup . It includes a ProgressBar and
I have an Android view that includes a RadioGroup with three RadioButtons. When one
I have a view model with a from that includes a set of checkboxes.
I have a view that has a list of jobs in it, with data
I have a view that I want to add some custom drawing to. I
I have a View that can vary significantly, depending on the 'mode' a particular

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.