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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:01:24+00:00 2026-06-11T16:01:24+00:00

I have been looking over the internet, but could not find the perfect tutorial

  • 0

I have been looking over the internet, but could not find the perfect tutorial for threading in iOS, currently i am working on iOS 5 , tutorial found on web were old, my app needs to fetch data from webservices, so I want to call network operation in a thread, I have a tabbar, in each tab it loads different type of data from web, as it start fetching data , I dont want my app to stuck on that tab, i want that user can navigate to other tab meanwhile its fetching data for that tab. how can it be possible

EDIT: I want to have a flow :

 //in a thread
 fetchDataFromWeb(){//during this call activity indicator
 //fetch and make an array of ojbects     
 }

when data is loaded trigger the populate funciton

laoddata(){//remove activity indicator
//load tableview and other views
}

how will i know my thread finished its process

  • 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-11T16:01:25+00:00Added an answer on June 11, 2026 at 4:01 pm

    Take a look to NSOperation, NSThread or Grand Central Dispatch

    Edit: NSThread example

    //on main thread on some action
     NSDictionary *myParameterDitionary = [..];
     [NSThread detachNewThreadSelector:@selector(aBackThreadMethod:) toTarget:self withObject:myParameterDitionary];
    
    //this is on back thread called
    - (void)aBackThreadMethod:(NSDictionary *)variablesDictionary{
        @autoreleasepool {
            //presess data
            NSDictionary *responseDictionary = [..];
            [self performSelectorOnMainThread:@selector(didABackThreadMethod:) withObject:responseDictionary waitUntilDone:YES];
        }
    }
    
    //call back on main thread
    - (void)didFinishABackThreadMethod:(NSDictionary *)responseDictionary{
       //do stuff ex update views
    }
    

    The @autoreleasepool is for ARC. If you use manual memory management you have to do:

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    [pool release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking over the internet for a while about this, but it
I have been looking over the web but have not come across an answer
Right guys, I have been looking all over the internet for a tutorial to
I have been looking all over the internet and i found some good guides
I have been looking all over the Internet for an answer to this question
I have been looking over the web for this but I can't seem to
I've been looking all over the internet and I can't find an acceptable solution
I have been searching over the internet for the past few hours looking for
I've been looking all over the internet for an answer, and I didn't find
I have been looking all over MSDN and can't find a reason why Thread

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.