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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:35:59+00:00 2026-05-23T16:35:59+00:00

I have an app which has UITabBar with 5 views, each attached to a

  • 0

I have an app which has UITabBar with 5 views, each attached to a different UIWebView. Each of the WebViews responds to:

webViewDidStartLoad:(UIWebView *)webView
webViewDidFinishLoad:(UIWebView *)webView

Those two are responsible for displaying a loading screen (separate image for each tab, toggled visible or not) and activity indicator.

It all works fine when the page is loaded to WebView. User taps a link on the page, loading image is displayed along with the activity indicator. When the page is loaded they both disappear and new website is presented.

The problem is when user taps on one of the TabBar items. App intercepts the event and launches a method in appropriate view, which is refreshing the page.

The problem: after the tap view changes immediately to the other WebView, however loading screen takes a long time to appear (from what I gather it only shows when the page passed to homeView starts loading) and I can’t figure out why. Displaying loading items is the first thing the app should do after method is called.

Here is the code that calls a method from TabBar controller:

[hv performSelector:@selector(goToPage) withObject:nil afterDelay:0.0];

and here is the goToPage method:

- (void) goToPage
{
    homeView.delegate = self;

    self.showLoading;

    NSURL *url = [NSURL URLWithString: [NSString stringWithFormat: @"%@/seed.php", appURL]];
    NSString *body = [NSString stringWithFormat: @"uid=%@", uID];
    NSData *data = [body dataUsingEncoding:NSUTF8StringEncoding];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:url];
    [request setHTTPMethod: @"POST"];
    [request setHTTPBody: data];
    NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    [request release];
    NSString *seedString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];

    NSArray *seedArray = [seedString componentsSeparatedByString:@":::"];

    NSString *eventNumber = [[seedArray objectAtIndex:0] retain];
    NSString *passedSid = [[seedArray objectAtIndex:1] retain];

    if (!seedString) {
        // can't connect
        NSLog(@"Can't connect.");
    }else {
        // connected
        NSLog(@"Events: %@", eventNumber);
        if(![evtNo isEqualToString:eventNumber]){
            evtNo = eventNumber;
            if(![evtNo isEqualToString:@"0"]){
                AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);
            }
        }
    }

    NSURL *urlView = [NSURL URLWithString: [NSString stringWithFormat: @"%@/index.php", appURL]];
    NSString *bodyView = [NSString stringWithFormat: @"sid=%@", passedSid];
    NSData *dataView = [bodyView dataUsingEncoding:NSUTF8StringEncoding];
    NSMutableURLRequest *requestView = [[NSMutableURLRequest alloc]initWithURL:urlView];
    [requestView setHTTPMethod: @"POST"];
    [requestView setHTTPBody: dataView];
    [homeView loadRequest: requestView];

    if([evtNo isEqualToString:@"0"]){
        // clearing badge
        [[[[[self tabBarController] viewControllers] objectAtIndex: 0] tabBarItem] setBadgeValue: nil];
    }else{
        [[[[[self tabBarController] viewControllers] objectAtIndex: 0] tabBarItem] setBadgeValue: evtNo];
    }
}

The goal I have is to display the loading image the moment user taps the TabBar item and remain visible until page stops loading.

  • 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-23T16:36:00+00:00Added an answer on May 23, 2026 at 4:36 pm

    The solution to this issue was to launch the method goToPage without the delay, display loading screen in goToPage and move the time consuming bits into another method inside that class, launched using persormSelector.

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

Sidebar

Related Questions

I have an app which has different app identifier for iphone and ipad and
I have rails app which has a list of users. I have different relations
I have an app which has a UITabBarController, and when different tabs are pressed,
I have an iPhone app with a UITabBar, and each tab has a unique
sorry for the newbie question: I have an app which has projects with different
I have an app which has split view inside a tab bar, and these
I have an iPhone app which has a Table View-based data input screen with
I have a .net winforms app which has a few animation effects, fade ins
I have an view in my App which has a number of buttons based
I have a user profile page on my web app which has contact information.

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.