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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:52:47+00:00 2026-05-18T19:52:47+00:00

I have a UITabBar Application with two views that load large amounts of data

  • 0

I have a UITabBar Application with two views that load large amounts of data from the web in their “viewWillAppear” methods. I want to show a progress bar or an activity indicator while this data is being retrieved, to make sure the user knows the app isn’t frozen.

I am aware that this has been asked before. I simply need some clarification on what seems to be a rather good solution.

I have implimented the code in the example. The question’s original asker later solved their problem, by putting the retrieval of data into another “thread”. I understand the concept of threads, but I do not know how I would impliment this.

With research, I have found that I need to move all of my heavy data retrieval into a background thread, as all of the UI updating occurs in the main thread.

If one would be so kind as to provide an example for me, I would be very appreciative. I can provide parts of my existing code as necessary.

  • 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-18T19:52:48+00:00Added an answer on May 18, 2026 at 7:52 pm

    If you use NSURLConnection it runs on another thread automatically.

    in your viewDidLoad:

    NSURLRequest *req = [NSURLRequest requestWithURL:theURL];
    NSURLConnection *conn = [NSURLConnection connectionWithRequest:req delegate:self];
    

    then you need some custom methods. If you type in -connection and press Esc you’ll see all the different methods you can use. There are three you will need with this:

    - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
        // this is called when there is a response
            // if you're collecting data init your NSMutableData here
    }
    
    -(void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
        // each time the connection downloads a 
            // packet of data it gets send here
            // so you can do [myData appendData:data];
    } 
    
    - (void) connectionDidFinishLoading:(NSURLConnection *)connection {
            // the connection has finished so you can 
            // do what you want with the data here
    }
    

    That is basically all there is to it. NSURLConnection handles all the multithreading itself and you don’t have to worry. Now you can create an activity indicator and display it and it will work because the main thread is empty. 🙂

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

Sidebar

Related Questions

I have a UITabBar + UINavigationController application which often needs data from the internet.
Have a n-tire web application and search often times out after 30 secs. How
I build my first iPhone application and I have a problem with switching views.
I have created an UITabView application. Each view selected from the bar is a
I have a UITabBar in my application with three tab bar items. At certain
I have a UITabBar in the detail view of my navigation based application. I
I Have a normal view based application and have added an UITabBar component. I
I have a UITabBar application with 4 tabs. Each tab has it's own ViewController.
In my application I have a uitabbar contoller for managing the three view controllers.
I have an iPhone application that's using Navigation Controller to display the top bar

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.